Skip to content

Commit

Permalink
Add maintainer approval check
Browse files Browse the repository at this point in the history
Signed-off-by: Peter Nied <[email protected]>
  • Loading branch information
peternied committed Nov 28, 2023
1 parent c4e703f commit 7fdf51d
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/maintainer-approved.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Check if maintainers have approved this PR

on:
pull_request_review:
types: [submitted]

pull_request_target:
types: [opened, reopened]

jobs:
maintainer-approved-check:
runs-on: ubuntu-latest
steps:
- id: find-maintainers
uses: actions/github-script@v7
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
result-encoding: string
script: |
const maintainersList = await github.request('GET GET /repos/{owner}/{repo}/collaborators', {
owner: 'OWNER',
repo: 'REPO',
repository_id: 'my-repoid',
permission: 'maintain',
affiliation: 'all',
per_page: 100
});
console.log(JSON.stringify(maintainersList));
return "a, b, c"
- uses: peternied/approved-by-maintainers@main
with:
token: ${{ secrets.GITHUB_TOKEN }}
min-required: 1
maintainers: ${{ steps.find-maintainers.outputs.result }}

0 comments on commit 7fdf51d

Please sign in to comment.