8000 fix: rename deprecated `@octokit/rest` methods · coderbyheart/github@b0eb9bd · GitHub
[go: up one dir, main page]

Skip to content

Commit b0eb9bd

Browse files
gr2mpvdlg
authored andcommitted
fix: rename deprecated @octokit/rest methods
1 parent caf1d52 commit b0eb9bd

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

lib/publish.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,11 @@ module.exports = async (pluginConfig, context) => {
5454
const upload = {
5555
url: uploadUrl,
5656
file: await readFile(resolve(cwd, filePath)),
57-
contentType: mime.getType(extname(fileName)) || 'text/plain',
58-
contentLength: file.size,
5957
name: fileName,
58+
headers: {
59+
'content-type': mime.getType(extname(fileName)) || 'text/plain',
60+
'content-length': file.size,
61+
},
6062
};
6163

6264
debug('file path: %o', filePath);
@@ -68,7 +70,7 @@ module.exports = async (pluginConfig, context) => {
6870

6971
const {
7072
data: {browser_download_url: downloadUrl},
71-
} = await github.repos.uploadAsset(upload);
73+
} = await github.repos.uploadReleaseAsset(upload);
7274
logger.log('Published file %s', downloadUrl);
7375
})
7476
);

lib/success.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ 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.getCommits({owner, repo, number})).data.find(({sha}) => shas.includes(sha)) ||
54+
(await github.pullRequests.listCommits({owner, repo, number})).data.find(({sha}) => shas.includes(sha)) ||
5555
shas.includes((await github.pullRequests.get({owner, repo, number})).data.merge_commit_sha)
5656
);
5757

@@ -121,7 +121,7 @@ module.exports = async (pluginConfig, context) => {
121121
debug('closing issue: %O', updateIssue);
122122
const {
123123
data: {html_url: url},
124-
} = await github.issues.edit(updateIssue);
124+
} = await github.issues.update(updateIssue);
125125
logger.log('Closed issue #%d: %s.', issue.number, url);
126126
} catch (error) {
127127
errors.push(error);

0 commit comments

Comments
 (0)
0