diff --git a/action/lib/approve.js b/action/lib/approve.js index 28f72f87..7ecef9ee 100644 --- a/action/lib/approve.js +++ b/action/lib/approve.js @@ -1,12 +1,12 @@ -module.exports = async function (octokit, context) { +module.exports = async function (octokit, { repo, payload: { pull_request } }) { // eslint-disable-line camelcase const { data: { id } } = await octokit.pulls.createReview({ - ...context.repo, - pull_number: context.pull_request.number + ...repo, + pull_number: pull_request.number }) await octokit.pulls.submitReview({ - ...context.repo, - pull_number: context.pull_request.number, + ...repo, + pull_number: pull_request.number, event: 'APPROVE', review_id: id }) diff --git a/action/lib/comment.js b/action/lib/comment.js index a8c97fd5..6a9cec66 100644 --- a/action/lib/comment.js +++ b/action/lib/comment.js @@ -1,7 +1,7 @@ -module.exports = async function (octokit, context, body) { +module.exports = async function (octokit, { repo, payload: { pull_request } }, body) { // eslint-disable-line camelcase await octokit.issues.createComment({ - ...context.repo, - issue_number: context.pull_request.number, + ...repo, + issue_number: pull_request.number, body }) }