Skip to content

Commit

Permalink
fix(action): correctly process github.context objects
Browse files Browse the repository at this point in the history
  • Loading branch information
Ahmad Nassri committed Aug 21, 2020
1 parent 0546404 commit bdb2119
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
10 changes: 5 additions & 5 deletions action/lib/approve.js
Original file line number Diff line number Diff line change
@@ -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
})
Expand Down
6 changes: 3 additions & 3 deletions action/lib/comment.js
Original file line number Diff line number Diff line change
@@ -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
})
}

0 comments on commit bdb2119

Please sign in to comment.