diff --git a/.github/workflows/maintainer-approval.yml b/.github/workflows/maintainer-approval.yml index f478ed97ac..60d2cd7fc3 100644 --- a/.github/workflows/maintainer-approval.yml +++ b/.github/workflows/maintainer-approval.yml @@ -22,7 +22,11 @@ jobs: # This name is the required status check context. Changing it silently # breaks the ruleset entry that gates merges on this job. name: OpenShell / Maintainer Approval - if: github.repository_owner == 'NVIDIA' + # Merge-group checks do not need to repeat the PR approval evaluation. + if: >- + github.repository_owner == 'NVIDIA' && + github.event_name != 'merge_group' && + github.event.pull_request.state == 'open' runs-on: ubuntu-latest timeout-minutes: 5 steps: @@ -45,23 +49,10 @@ jobs: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} GH_REPO: ${{ github.repository }} PR_NUMBER: ${{ github.event.pull_request.number }} - # merge_group carries no pull request in its payload, but the queue - # branch names the entry: gh-readonly-queue/main/pr-3027-. - MERGE_GROUP_REF: ${{ github.ref_name }} shell: bash run: | set -euo pipefail - if [ -z "${PR_NUMBER:-}" ]; then - if [[ "$MERGE_GROUP_REF" =~ /pr-([0-9]+)-[0-9a-f]+$ ]]; then - PR_NUMBER="${BASH_REMATCH[1]}" - else - # Fail closed: an unrecognised ref must never satisfy the gate. - echo "::error::No pull request resolved from '$MERGE_GROUP_REF'." - exit 1 - fi - fi - gh api --paginate "repos/$GH_REPO/pulls/$PR_NUMBER/reviews" --jq '.[]' \ | jq -s '.' > reviews.json