Skip to content

Commit fa677fa

Browse files
immanuel192gr2m
authored andcommitted
fix: adapt for latest @octokit/rest to remove deprecation warnings (#177)
1 parent d2d873c commit fa677fa

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

lib/fail.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@ module.exports = async (pluginConfig, context) => {
3030

3131
if (srIssue) {
3232
logger.log('Found existing semantic-release issue #%d.', srIssue.number);
33-
const comment = {owner, repo, number: srIssue.number, body};
33+
// eslint-disable-next-line camelcase
34+
const comment = {owner, repo, issue_number: srIssue.number, body};
3435
debug('create comment: %O', comment);
3536
const {
3637
data: {html_url: url},

lib/success.js

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,10 @@ module.exports = async (pluginConfig, context) => {
5151
const prs = await pFilter(
5252
uniqBy(flatten(await Promise.all(searchQueries)), 'number'),
5353
async ({number}) =>
54-
(await github.pullRequests.listCommits({owner, repo, number})).data.find(({sha}) => shas.includes(sha)) ||
55-
shas.includes((await github.pullRequests.get({owner, repo, number})).data.merge_commit_sha)
54+
// eslint-disable-next-line camelcase
55+
(await github.pullRequests.listCommits({owner, repo, pull_number: number})).data.find(({sha}) =>
56+
shas.includes(sha)
57+
) || shas.includes((await github.pullRequests.get({owner, repo, pull_number: number})).data.merge_commit_sha) // eslint-disable-line camelcase
5658
);
5759

5860
debug('found pull requests: %O', prs.map(pr => pr.number));
@@ -76,10 +78,12 @@ module.exports = async (pluginConfig, context) => {
7678
? template(successComment)({branch, lastRelease, commits, nextRelease, releases, issue})
7779
: getSuccessComment(issue, releaseInfos, nextRelease);
7880
try {
79-
const state = issue.state || (await github.issues.get({owner, repo, number: issue.number})).data.state;
81+
// eslint-disable-next-line camelcase
82+
const state = issue.state || (await github.issues.get({owner, repo, issue_number: issue.number})).data.state;
8083

8184
if (state === 'closed') {
82-
const comment = {owner, repo, number: issue.number, body};
85+
// eslint-disable-next-line camelcase
86+
const comment = {owner, repo, issue_number: issue.number, body};
8387
debug('create comment: %O', comment);
8488
const {
8589
data: {html_url: url},
@@ -124,7 +128,8 @@ module.exports = async (pluginConfig, context) => {
124128
srIssues.map(async issue => {
125129
debug('close issue: %O', issue);
126130
try {
127-
const updateIssue = {owner, repo, number: issue.number, state: 'closed'};
131+
// eslint-disable-next-line camelcase
132+
const updateIssue = {owner, repo, issue_number: issue.number, state: 'closed'};
128133
debug('closing issue: %O', updateIssue);
129134
const {
130135
data: {html_url: url},

0 commit comments

Comments
 (0)