Skip to content

Commit ce7174b

Browse files
Merge branch 'main' into refactor-release-signing-v2
2 parents 54d05c4 + 9e7b76a commit ce7174b

File tree

6 files changed

+17
-130
lines changed

6 files changed

+17
-130
lines changed

.github/scripts/highlights.mjs

Lines changed: 12 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,22 @@
11
// @ts-check
22
import * as process from 'node:process';
3-
import { Octokit } from '@octokit/core';
43
import { output } from './util.mjs';
54

65
const {
76
GITHUB_TOKEN = '',
87
PR_LIST = '',
9-
owner = 'mongodb',
10-
repo = 'js-bson'
8+
REPOSITORY = ''
119
} = process.env;
1210
if (GITHUB_TOKEN === '') throw new Error('GITHUB_TOKEN cannot be empty');
11+
if (REPOSITORY === '') throw new Error('REPOSITORY cannot be empty')
1312

14-
const octokit = new Octokit({
15-
auth: GITHUB_TOKEN,
16-
log: {
17-
debug: msg => console.error('Octokit.debug', msg),
18-
info: msg => console.error('Octokit.info', msg),
19-
warn: msg => console.error('Octokit.warn', msg),
20-
error: msg => console.error('Octokit.error', msg)
13+
const API_REQ_INFO = {
14+
headers: {
15+
Accept: 'application/vnd.github.v3+json',
16+
'X-GitHub-Api-Version': '2022-11-28',
17+
Authorization: `Bearer ${GITHUB_TOKEN}`
2118
}
22-
});
19+
}
2320

2421
const prs = PR_LIST.split(',').map(pr => {
2522
const prNum = Number(pr);
@@ -35,13 +32,10 @@ async function getPullRequestContent(pull_number) {
3532

3633
let body;
3734
try {
38-
const res = await octokit.request('GET /repos/{owner}/{repo}/pulls/{pull_number}', {
39-
owner,
40-
repo,
41-
pull_number,
42-
headers: { 'X-GitHub-Api-Version': '2022-11-28' }
43-
});
44-
body = res.data.body;
35+
const response = await fetch(new URL(`https://api.github.com/repos/${REPOSITORY}/pulls/${pull_number}`), API_REQ_INFO);
36+
if (!response.ok) throw new Error(await response.text());
37+
const pr = await response.json();
38+
body = pr.body;
4539
} catch (error) {
4640
console.log(`Could not get PR ${pull_number}, skipping. ${error.status}`);
4741
return '';

.github/workflows/release-5.x.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,8 @@ jobs:
6161
aws_secret_id: ${{ secrets.aws_secret_id }}
6262

6363
- name: "Generate Sarif Report"
64-
uses: "alcaeus/drivers-github-tools/code-scanning-export@export-code-scanning-report"
64+
# TODO: Use v2 once it has been re-tagged to include this action
65+
uses: mongodb-labs/drivers-github-tools/code-scanning-export@main
6566
with:
6667
ref: 5.x
6768
output-file: sarif-report.json

.github/workflows/release.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,8 @@ jobs:
5959
aws_secret_id: ${{ secrets.aws_secret_id }}
6060

6161
- name: "Generate Sarif Report"
62-
uses: "alcaeus/drivers-github-tools/code-scanning-export@export-code-scanning-report"
62+
# TODO: Use v2 once it has been re-tagged to include this action
63+
uses: mongodb-labs/drivers-github-tools/code-scanning-export@main
6364
with:
6465
ref: main
6566
output-file: sarif-report.json

.github/workflows/release_notes.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ jobs:
6464
env:
6565
GITHUB_TOKEN: ${{ github.token }}
6666
PR_LIST: ${{ steps.pr_list.outputs.pr_list }}
67+
REPOSITORY: ${{ github.repository }}
6768

6869
# The combined output is available
6970
- id: release_notes

package-lock.json

Lines changed: 0 additions & 109 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
"devDependencies": {
2929
"@istanbuljs/nyc-config-typescript": "^1.0.2",
3030
"@microsoft/api-extractor": "^7.43.1",
31-
"@octokit/core": "^6.1.2",
3231
"@rollup/plugin-node-resolve": "^15.2.3",
3332
"@rollup/plugin-typescript": "^11.1.6",
3433
"@types/chai": "^4.3.14",

0 commit comments

Comments
 (0)