Skip to content

Commit 5a7728c

Browse files
authored
fix(ci): skip maintainer approval in merge queue (#4496)
* fix(ci): skip maintainer approval in merge queue Signed-off-by: Jim Meyer <[email protected]> * refactor(ci): remove maintainer queue-state lookup Signed-off-by: Jim Meyer <[email protected]> --------- Signed-off-by: Jim Meyer <[email protected]>
1 parent d3e6a35 commit 5a7728c

1 file changed

Lines changed: 5 additions & 14 deletions

File tree

‎.github/workflows/maintainer-approval.yml‎

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,11 @@ jobs:
2222
# This name is the required status check context. Changing it silently
2323
# breaks the ruleset entry that gates merges on this job.
2424
name: OpenShell / Maintainer Approval
25-
if: github.repository_owner == 'NVIDIA'
25+
# Merge-group checks do not need to repeat the PR approval evaluation.
26+
if: >-
27+
github.repository_owner == 'NVIDIA' &&
28+
github.event_name != 'merge_group' &&
29+
github.event.pull_request.state == 'open'
2630
runs-on: ubuntu-latest
2731
timeout-minutes: 5
2832
steps:
@@ -45,23 +49,10 @@ jobs:
4549
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4650
GH_REPO: ${{ github.repository }}
4751
PR_NUMBER: ${{ github.event.pull_request.number }}
48-
# merge_group carries no pull request in its payload, but the queue
49-
# branch names the entry: gh-readonly-queue/main/pr-3027-<base sha>.
50-
MERGE_GROUP_REF: ${{ github.ref_name }}
5152
shell: bash
5253
run: |
5354
set -euo pipefail
5455
55-
if [ -z "${PR_NUMBER:-}" ]; then
56-
if [[ "$MERGE_GROUP_REF" =~ /pr-([0-9]+)-[0-9a-f]+$ ]]; then
57-
PR_NUMBER="${BASH_REMATCH[1]}"
58-
else
59-
# Fail closed: an unrecognised ref must never satisfy the gate.
60-
echo "::error::No pull request resolved from '$MERGE_GROUP_REF'."
61-
exit 1
62-
fi
63-
fi
64-
6556
gh api --paginate "repos/$GH_REPO/pulls/$PR_NUMBER/reviews" --jq '.[]' \
6657
| jq -s '.' > reviews.json
6758

0 commit comments

Comments
 (0)