@@ -3,6 +3,10 @@ name: status-checks
33on :
44 pull_request :
55 types : [labeled, opened, reopened, synchronize]
6+ merge_group :
7+ branches :
8+ - main
9+ types : [checks_requested]
610
711permissions :
812 pull-requests : write
@@ -11,7 +15,7 @@ permissions:
1115jobs :
1216 github-ui :
1317 runs-on : ubuntu-latest
14- if : " ${{ contains(github.event.pull_request.labels.*.name, 'integration-tests: skipped manually') }}"
18+ if : " ${{ (github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'integration-tests: skipped manually')) || github.event_name == 'merge_group' }}"
1519 steps :
1620 - name : Generate token for primer
1721 id : generate_primer_token
2024 app-id : 902635
2125 owner : ' primer'
2226 private-key : ${{ secrets.PRIMER_INTEGRATION_APP_PRIVATE_KEY }}
23- - name : Override status checks
27+ - name : Override status checks for pull request
28+ if : " ${{ github.event_name == 'pull_request' }}"
2429 run : |
2530 # Get the timeline event ID for the label being added
2631 EVENT_ID=$(gh api "/repos/primer/react/issues/$PR_NUMBER/timeline" \
4752 -f target_url="$TARGET_URL"
4853 env :
4954 GH_TOKEN : ${{ steps.generate_primer_token.outputs.token }}
50- SHA : ${{ github.event.pull_request.head.sha }}
5155 PR_NUMBER : ${{ github.event.pull_request.number }}
56+ SHA : ${{ github.event.pull_request.head.sha }}
57+ - name : Override status checks for merge queue
58+ if : " ${{ github.event_name == 'merge_group' }}"
59+ run : |
60+ gh api -X POST "/repos/primer/react/statuses/${{ github.event.merge_group.head_sha }}" \
61+ -f state='success' \
62+ -f context='github-ui / ci' \
63+ -f description='Skipped'
64+
65+ gh api -X POST "/repos/primer/react/statuses/${{ github.event.merge_group.head_sha }}" \
66+ -f state='success' \
67+ -f context='github-ui / projects' \
68+ -f description='Skipped'
69+ env :
70+ GH_TOKEN : ${{ steps.generate_primer_token.outputs.token }}
0 commit comments