Skip to content

Commit

Permalink
refactor(approval): pR approvals can be done with one api call
Browse files Browse the repository at this point in the history
  • Loading branch information
Ahmad Nassri committed Aug 25, 2020
1 parent 8a0c0f9 commit 1da24bb
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions action/lib/api.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,8 @@
export async function approve (octokit, repo, { number }) {
const { data: { id } } = await octokit.pulls.createReview({
...repo,
pull_number: number
})

await octokit.pulls.submitReview({
await octokit.pulls.createReview({
...repo,
pull_number: number,
event: 'APPROVE',
review_id: id
event: 'APPROVE'
})
}

Expand Down

0 comments on commit 1da24bb

Please sign in to comment.