Commit d8a29ce8 authored by Robert Knight's avatar Robert Knight

Update create-github-release script for Octokit auth API change

Update script to authenticate using the new API documented at
https://github.com/octokit/rest.js#authentication
parent 5cd5e229
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
* `v<VERSION>` where <VERSION> is the `version` field in package.json. * `v<VERSION>` where <VERSION> is the `version` field in package.json.
*/ */
const octokit = require('@octokit/rest')(); const Octokit = require('@octokit/rest');
const pkg = require('../package.json'); const pkg = require('../package.json');
const { changelistSinceTag } = require('./generate-change-list'); const { changelistSinceTag } = require('./generate-change-list');
...@@ -26,9 +26,8 @@ async function createGitHubRelease() { ...@@ -26,9 +26,8 @@ async function createGitHubRelease() {
throw new Error('GITHUB_TOKEN env var is not set'); throw new Error('GITHUB_TOKEN env var is not set');
} }
octokit.authenticate({ const octokit = new Octokit({
type: 'oauth', auth: `token ${process.env.GITHUB_TOKEN}`,
token: process.env.GITHUB_TOKEN,
}); });
const changes = await changelistSinceTag(octokit); const changes = await changelistSinceTag(octokit);
......
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