forked from opensearch-project/OpenSearch
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Backport 1.x] Maintainer approval check (opensearch-project#11378)
Signed-off-by: Peter Nied <[email protected]> Signed-off-by: Peter Nied <[email protected]> (cherry picked from commit 87b3011)
- Loading branch information
Showing
2 changed files
with
35 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
name: Maintainers approval | ||
|
||
on: | ||
pull_request_review: | ||
types: [submitted] | ||
|
||
jobs: | ||
maintainer-approved-check: | ||
name: Minimum approval count | ||
runs-on: ubuntu-latest | ||
steps: | ||
- id: find-maintainers | ||
uses: actions/github-script@v7 | ||
with: | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
result-encoding: string | ||
script: | | ||
// Get the collaborators - filtered to maintainer permissions | ||
const maintainersResponse = await github.request('GET /repos/{owner}/{repo}/collaborators', { | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
permission: 'maintain', | ||
affiliation: 'all', | ||
per_page: 100 | ||
}); | ||
return maintainersResponse.data.map(item => item.login).join(', '); | ||
- uses: peternied/[email protected] | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
min-required: 1 | ||
required-approvers-list: ${{ steps.find-maintainers.outputs.result }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters