Commit 9b9510cf authored by Robert Knight's avatar Robert Knight

Update GitHub API authentication in release scripts

Per the example in https://github.com/octokit/core.js/#rest-api-example
the value for the `auth` property in the `Octokit` constructor is now just
the personal access token, not `token $TOKEN`. The old format still
works with a recently generated token though.

To test:

```sh
export GITHUB_TOKEN=$TOKEN
node scripts/generate-change-list.js $PREV_CLIENT_VERSION
```

Where `$TOKEN` is a token generated at https://github.com/settings/tokens and
`$PREV_CLIENT_VERSION` is the previous released version of the client to
use as a starting point for the change list.
parent fcfde74a
......@@ -29,7 +29,7 @@ async function createGitHubRelease() {
}
const octokit = new Octokit({
auth: `token ${process.env.GITHUB_TOKEN}`,
auth: process.env.GITHUB_TOKEN,
});
const changes = await changelistSinceTag(octokit);
......
......@@ -137,7 +137,7 @@ async function changelistSinceTag(octokit, tag = getHighestVersionTag()) {
if (require.main === module) {
const { Octokit } = require('@octokit/rest');
const octokit = new Octokit({ auth: `token ${process.env.GITHUB_TOKEN}` });
const octokit = new Octokit({ auth: process.env.GITHUB_TOKEN });
const tag = process.argv[2] || getHighestVersionTag();
changelistSinceTag(octokit, tag)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment