1name: Merge Group
2
3on:
4 merge_group:
5 workflow_call:
6 inputs:
7 mergedSha:
8 required: true
9 type: string
10 targetSha:
11 required: true
12 type: string
13 secrets:
14 CACHIX_AUTH_TOKEN:
15 required: true
16
17permissions: {}
18
19jobs:
20 lint:
21 name: Lint
22 uses: ./.github/workflows/lint.yml
23 secrets:
24 CACHIX_AUTH_TOKEN: ${{ secrets.CACHIX_AUTH_TOKEN }}
25 with:
26 mergedSha: ${{ inputs.mergedSha || github.event.merge_group.head_sha }}
27 targetSha: ${{ inputs.targetSha || github.event.merge_group.base_sha }}
28
29 # This job's only purpose is to create the target for the "Required Status Checks" branch ruleset.
30 # It "needs" all the jobs that should block the Merge Queue.
31 unlock:
32 if: github.event_name != 'pull_request' && always()
33 # Modify this list to add or remove jobs from required status checks.
34 needs:
35 - lint
36 runs-on: ubuntu-24.04-arm
37 permissions:
38 statuses: write
39 steps:
40 - uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
41 env:
42 RESULTS: ${{ toJSON(needs.*.result) }}
43 with:
44 script: |
45 const { serverUrl, repo, runId, payload } = context
46 const target_url =
47 `${serverUrl}/${repo.owner}/${repo.repo}/actions/runs/${runId}`
48 await github.rest.repos.createCommitStatus({
49 ...repo,
50 sha: payload.merge_group.head_sha,
51 // WARNING:
52 // Do NOT change the name of this, otherwise the rule will not catch it anymore.
53 // This would prevent all PRs from merging.
54 context: 'no PR failures',
55 state: JSON.parse(process.env.RESULTS).every(result => result == 'success') ? 'success' : 'error',
56 target_url,
57 })