Skip to content

Commit

Permalink
finally
Browse files Browse the repository at this point in the history
  • Loading branch information
Ankeet Maini authored and Ankeet Maini committed Sep 17, 2022
1 parent fcab6fc commit 5d9f6cb
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 11 deletions.
5 changes: 0 additions & 5 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

6 changes: 1 addition & 5 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,7 @@ async function run(): Promise<void> {

const octokit = new Octokit()
const [owner, repo] = process.env.GITHUB_REPOSITORY!.split('/')
console.log(owner, repo)
const pull_number = github.context.issue.number
console.log({pull_number})
const res: reviewsResponse = await octokit.request(
'GET /repos/{owner}/{repo}/pulls/{pull_number}/reviews',
{
Expand All @@ -26,12 +24,11 @@ async function run(): Promise<void> {
per_page: 100
}
)
console.log({res})
const reviews = res.data
.map(d => {
const login = d?.user?.login
const state = d?.state
console.log({login, state})

if (login && group.includes(login) && state === 'APPROVED') {
return login
}
Expand All @@ -40,7 +37,6 @@ async function run(): Promise<void> {
.filter(Boolean)
if (reviews.length < count) core.setFailed('Mandatory review check failed')
} catch (error) {
console.log(error)
if (error instanceof Error) core.setFailed(error.message)
}
}
Expand Down

0 comments on commit 5d9f6cb

Please sign in to comment.