forked from opensearch-project/OpenSearch
-
Notifications
You must be signed in to change notification settings - Fork 0
32 lines (28 loc) · 1.01 KB
/
maintainer-approval.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
name: Maintainers approval
on:
pull_request_review:
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 }}