Skip to content

Commit

Permalink
[Backport 1.3] Maintainer approval check (#11378) (#11580)
Browse files Browse the repository at this point in the history
  • Loading branch information
peternied committed Dec 12, 2023
1 parent 540328d commit 887e17e
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 0 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/maintainer-approval.yml
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/required-approval@v1.2
with:
token: ${{ secrets.GITHUB_TOKEN }}
min-required: 1
required-approvers-list: ${{ steps.find-maintainers.outputs.result }}
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)

### Added
- Improve compressed request handling ([#10261](https://github.com/opensearch-project/OpenSearch/pull/10261))
- Maintainer approval check ([#11378](https://github.com/opensearch-project/OpenSearch/pull/11378))

### Dependencies
- Bump asm from 9.5 to 9.6 ([#10302](https://github.com/opensearch-project/OpenSearch/pull/10302))
Expand Down

0 comments on commit 887e17e

Please sign in to comment.