Skip to content

Commit

Permalink
Update .github/workflows/pr-approvals.yaml
Browse files Browse the repository at this point in the history
Co-authored-by: Alexander Kuzmenkov <[email protected]>
Signed-off-by: Sven Klemm <[email protected]>
  • Loading branch information
svenklemm and akuzm authored Oct 18, 2024
1 parent 094764e commit e73451c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/pr-approvals.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ jobs:
if [[ $? -ne 0 ]]; then
# Get the list of modified files in this pull request
files=$(gh pr view $PR_NUMBER --json files --jq '.files.[].path')
# Get the list of modified files in this pull request
approvals=$(gh pr view $PR_NUMBER --json reviews --jq '.reviews.[].state' | grep APPROVED | wc -l)
# Get the list of approvals in this pull request
approvals=$(gh pr view $PR_NUMBER --json reviews --jq '[.reviews.[] | select(.authorAssociation == "MEMBER" and .state == "APPROVED")] | length')
if [[ $approvals -lt 2 ]] && echo "${files}" | grep -Eq "^.github"; then
echo "This pull request requires 2 approvals before merging."
Expand Down

0 comments on commit e73451c

Please sign in to comment.