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 6d4dfab
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/maintainer-approved.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
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 /repos/{owner}/{repo}/collaborators', {
owner: 'peternied',
repo: 'OpenSearch-1',
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 6d4dfab

Please sign in to comment.