Skip to content

Commit e338bd6

Browse files
Copilotjoshblack
andauthored
Add merge_group trigger support to status-checks workflow (#7163)
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: joshblack <3901764+joshblack@users.noreply.github.com> Co-authored-by: Josh Black <joshblack@github.com>
1 parent b78167a commit e338bd6

File tree

1 file changed

+22
-3
lines changed

1 file changed

+22
-3
lines changed

.github/workflows/status-checks.yml

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@ name: status-checks
33
on:
44
pull_request:
55
types: [labeled, opened, reopened, synchronize]
6+
merge_group:
7+
branches:
8+
- main
9+
types: [checks_requested]
610

711
permissions:
812
pull-requests: write
@@ -11,7 +15,7 @@ permissions:
1115
jobs:
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
@@ -20,7 +24,8 @@ jobs:
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" \
@@ -47,5 +52,19 @@ jobs:
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

Comments
 (0)