Skip to content

Commit

Permalink
chore(NODE-6170): update release please owner
Browse files Browse the repository at this point in the history
  • Loading branch information
nbbeeken committed May 20, 2024
1 parent 7c91272 commit cca9d32
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 129 deletions.
30 changes: 12 additions & 18 deletions .github/scripts/highlights.mjs
Original file line number Diff line number Diff line change
@@ -1,25 +1,22 @@
// @ts-check
import * as process from 'node:process';
import { Octokit } from '@octokit/core';
import { output } from './util.mjs';

const {
GITHUB_TOKEN = '',
PR_LIST = '',
owner = 'mongodb',
repo = 'node-mongodb-native'
REPOSITORY = ''
} = process.env;
if (GITHUB_TOKEN === '') throw new Error('GITHUB_TOKEN cannot be empty');
if (REPOSITORY === '') throw new Error('REPOSITORY cannot be empty')

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

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

let body;
try {
const res = await octokit.request('GET /repos/{owner}/{repo}/pulls/{pull_number}', {
owner,
repo,
pull_number,
headers: { 'X-GitHub-Api-Version': '2022-11-28' }
});
body = res.data.body;
const response = await fetch(new URL(`https://api.github.com/repos/${REPOSITORY}/pulls/${pull_number}`), API_REQ_INFO);
if (!response.ok) throw new Error(await response.text());
const pr = await response.json();
body = pr.body;
} catch (error) {
console.log(`Could not get PR ${pull_number}, skipping. ${error.status}`);
return '';
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- id: release
uses: google-github-actions/release-please-action@v4
uses: googleapis/release-please-action@v4

# If release-please created a release, publish to npm
- if: ${{ steps.release.outputs.release_created }}
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/release_notes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ jobs:
env:
GITHUB_TOKEN: ${{ github.token }}
PR_LIST: ${{ steps.pr_list.outputs.pr_list }}
REPOSITORY: ${{ github.repository }}

# The combined output is available
- id: release_notes
Expand Down
109 changes: 0 additions & 109 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@
"@microsoft/api-extractor": "^7.43.1",
"@microsoft/tsdoc-config": "^0.16.2",
"@mongodb-js/zstd": "^1.2.0",
"@octokit/core": "^6.1.2",
"@types/chai": "^4.3.14",
"@types/chai-subset": "^1.3.5",
"@types/express": "^4.17.21",
Expand Down

0 comments on commit cca9d32

Please sign in to comment.