Skip to content

Commit b2bc352

Browse files
immanuel192pvdlg
authored andcommittedMay 9, 2019
fix: adapt for latest @octokit/rest to remove deprecation warnings (#177)
1 parent 3dc6bca commit b2bc352

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed
 

‎lib/fail.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ module.exports = async (pluginConfig, context) => {
3131

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

‎lib/success.js

+7-4
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,10 @@ module.exports = async (pluginConfig, context) => {
5050
const prs = await pFilter(
5151
uniqBy(flatten(await Promise.all(searchQueries)), 'number'),
5252
async ({number}) =>
53-
(await github.pullRequests.listCommits({owner, repo, number})).data.find(({sha}) => shas.includes(sha)) ||
54-
shas.includes((await github.pullRequests.get({owner, repo, number})).data.merge_commit_sha)
53+
// eslint-disable-next-line camelcase
54+
(await github.pullRequests.listCommits({owner, repo, pull_number: number})).data.find(({sha}) =>
55+
shas.includes(sha)
56+
) || shas.includes((await github.pullRequests.get({owner, repo, pull_number: number})).data.merge_commit_sha) // eslint-disable-line camelcase
5557
);
5658

5759
debug('found pull requests: %O', prs.map(pr => pr.number));
@@ -75,7 +77,7 @@ module.exports = async (pluginConfig, context) => {
7577
? template(successComment)({...context, issue})
7678
: getSuccessComment(issue, releaseInfos, nextRelease);
7779
try {
78-
const comment = {owner, repo, number: issue.number, body};
80+
const comment = {owner, repo, issue_number: issue.number, body};
7981
debug('create comment: %O', comment);
8082
const {
8183
data: {html_url: url},
@@ -118,7 +120,8 @@ module.exports = async (pluginConfig, context) => {
118120
srIssues.map(async issue => {
119121
debug('close issue: %O', issue);
120122
try {
121-
const updateIssue = {owner, repo, number: issue.number, state: 'closed'};
123+
// eslint-disable-next-line camelcase
124+
const updateIssue = {owner, repo, issue_number: issue.number, state: 'closed'};
122125
debug('closing issue: %O', updateIssue);
123126
const {
124127
data: {html_url: url},

0 commit comments

Comments
 (0)
Please sign in to comment.