Skip to content

Commit

Permalink
Fix pr-approvals workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
svenklemm committed Oct 18, 2024
1 parent 2a5cbaa commit e44f53d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/pr-approvals.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ jobs:
echo "$BODY" | egrep -qsi '^disable-check:.*\<approval-count\>'
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 | select(startswith(".github") | not)')
files=$(gh pr view $PR_NUMBER --repo timescale/timescaledb --json files --jq '.files.[].path | select(startswith(".github") | not)')
# Get the number of approvals in this pull request
approvals=$(gh pr view $PR_NUMBER --json reviews --jq '[.reviews.[] | select(.authorAssociation == "MEMBER" and .state == "APPROVED")] | length')
approvals=$(gh pr view $PR_NUMBER --repo timescale/timescaledb --json reviews --jq '[.reviews.[] | select(.authorAssociation == "MEMBER" and .state == "APPROVED")] | length')
gh pr view $PR_NUMBER --json reviews --jq '[.reviews.[] | select(.authorAssociation == "MEMBER" and .state == "APPROVED")]'
gh pr view $PR_NUMBER --repo timescale/timescaledb --json reviews --jq '[.reviews.[] | select(.authorAssociation == "MEMBER" and .state == "APPROVED")]'
if [[ $approvals -lt 2 ]] && [[ "${files}" ]] ; then
echo "This pull request requires 2 approvals before merging."
Expand Down

0 comments on commit e44f53d

Please sign in to comment.