File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed
Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -96,23 +96,24 @@ jobs:
9696 name == '12.approved-by: package-maintainer'
9797 )
9898
99- const approvals =
99+ const approvals = new Set(
100100 (await github.paginate(github.rest.pulls.listReviews, {
101101 owner: context.repo.owner,
102102 repo: context.repo.repo,
103103 pull_number: pull_request.number
104104 }))
105105 .filter(review => review.state == 'APPROVED')
106106 .map(review => review.user.id)
107+ )
107108
108- const maintainers = Object.keys(
109+ const maintainers = new Set( Object.keys(
109110 JSON.parse(await readFile('comparison/maintainers.json', 'utf-8'))
110- )
111+ ))
111112
112113 // And the labels that should be there
113114 const after = JSON.parse(await readFile('comparison/changed-paths.json', 'utf-8')).labels
114- if (approvals.length > 0) after.push(`12.approvals: ${approvals.length > 2 ? '3+' : approvals.length }`)
115- if (maintainers.some(id => approvals.includes(id) )) after.push('12.approved-by: package-maintainer')
115+ if (approvals.size > 0) after.push(`12.approvals: ${approvals.size > 2 ? '3+' : approvals.size }`)
116+ if (Array.from( maintainers) .some(approvals.has )) after.push('12.approved-by: package-maintainer')
116117
117118 // Remove the ones not needed anymore
118119 await Promise.all(
You can’t perform that action at this time.
0 commit comments