Commit 34c0c3a4 authored by Robert Knight's avatar Robert Knight

Fix compatibility of create-github-release.js with @ocktokit/rest v17

https://github.com/hypothesis/client/pull/1824 bumped @ocktokit/rest to
v17.0.0 but this contained breaking changes which were not accounted
for.
parent 15236a2c
...@@ -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');
......
...@@ -58,7 +58,7 @@ async function* itemsInGitHubAPIResponse(octokit, options) { ...@@ -58,7 +58,7 @@ async function* itemsInGitHubAPIResponse(octokit, options) {
async function getPRsMergedSince(octokit, org, repo, tag) { async function getPRsMergedSince(octokit, org, repo, tag) {
const tagDate = getTagDate(tag); const tagDate = getTagDate(tag);
const options = await octokit.pullRequests.list.endpoint.merge({ const options = await octokit.pulls.list.endpoint.merge({
owner: org, owner: org,
repo, repo,
state: 'closed', state: 'closed',
...@@ -136,7 +136,7 @@ async function changelistSinceTag(octokit, tag = getHighestVersionTag()) { ...@@ -136,7 +136,7 @@ async function changelistSinceTag(octokit, tag = getHighestVersionTag()) {
} }
if (require.main === module) { if (require.main === module) {
const Octokit = require('@octokit/rest'); const { Octokit } = require('@octokit/rest');
const octokit = new Octokit({ auth: `token ${process.env.GITHUB_TOKEN}` }); const octokit = new Octokit({ auth: `token ${process.env.GITHUB_TOKEN}` });
const tag = process.argv[2] || getHighestVersionTag(); const tag = process.argv[2] || getHighestVersionTag();
......
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