Skip to content

Commit

Permalink
fix: rename deprecated @octokit/rest methods
Browse files Browse the repository at this point in the history
  • Loading branch information
gr2m authored and pvdlg committed Nov 21, 2018
1 parent caf1d52 commit b0eb9bd
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
8 changes: 5 additions & 3 deletions lib/publish.js
Expand Up @@ -54,9 +54,11 @@ module.exports = async (pluginConfig, context) => {
const upload = {
url: uploadUrl,
file: await readFile(resolve(cwd, filePath)),
contentType: mime.getType(extname(fileName)) || 'text/plain',
contentLength: file.size,
name: fileName,
headers: {
'content-type': mime.getType(extname(fileName)) || 'text/plain',
'content-length': file.size,
},
};

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

const {
data: {browser_download_url: downloadUrl},
} = await github.repos.uploadAsset(upload);
} = await github.repos.uploadReleaseAsset(upload);
logger.log('Published file %s', downloadUrl);
})
);
Expand Down
4 changes: 2 additions & 2 deletions lib/success.js
Expand Up @@ -51,7 +51,7 @@ module.exports = async (pluginConfig, context) => {
const prs = await pFilter(
uniqBy(flatten(await Promise.all(searchQueries)), 'number'),
async ({number}) =>
(await github.pullRequests.getCommits({owner, repo, number})).data.find(({sha}) => shas.includes(sha)) ||
(await github.pullRequests.listCommits({owner, repo, number})).data.find(({sha}) => shas.includes(sha)) ||
shas.includes((await github.pullRequests.get({owner, repo, number})).data.merge_commit_sha)
);

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

0 comments on commit b0eb9bd

Please sign in to comment.