Skip to content

Commit

Permalink
wip: fix code stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
wassimk committed Jun 3, 2024
1 parent 962ee22 commit aee495b
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,16 @@ async function run() {
const owner = github.context.payload.repository.owner.login
const repo = github.context.payload.repository.name

let requestedReviewers = []
const reviewRequests = await octokit.request('GET /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers', {
owner,
repo,
pull_number
}).then((res) => {
reviewRequests = res.data.users.map(u => u.login)
requestedReviewers = res.data.users.map(u => u.login);
})
console.og(`reviewRequests: ${JSON.stringify(reviewRequests, undefined, 2)}`)

let requestedReviewers = []
reviewRequests.forEach(reviewer => {
requestedReviewers.push(reviewer.login)
})
console.og(`reviewRequests: ${JSON.stringify(reviewRequests, undefined, 2)}`)
console.log(`requestedReviewers: ${JSON.stringify(requestedReviewers, undefined, 2)}`)

const prReviews = await octokit.request('GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews', {
Expand Down

0 comments on commit aee495b

Please sign in to comment.