Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 5 additions & 14 deletions .github/workflows/maintainer-approval.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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-<base sha>.
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

Expand Down
Loading