Skip to content

Commit b7a1b3e

Browse files
committed
Fix CI failing on PRs reaching master via the merge queue
1 parent 342160b commit b7a1b3e

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

.github/workflows/build.yml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ on:
4646
type: string
4747
pr_number:
4848
type: string
49+
merge_queue:
50+
type: boolean
4951

5052
jobs:
5153
web:
@@ -111,6 +113,7 @@ jobs:
111113
run: mold -run cargo run build web${{ inputs.debug && ' debug' || '' }}
112114

113115
- name: 📤 Publish to Cloudflare Pages
116+
if: inputs.merge_queue == false
114117
id: cloudflare
115118
continue-on-error: ${{ github.event_name != 'push' }}
116119
env:
@@ -143,7 +146,7 @@ jobs:
143146
exit 1
144147
145148
- name: 🚀 Create a GitHub environment deployment
146-
if: inputs.checkout_repo == '' || inputs.checkout_repo == github.repository
149+
if: (inputs.checkout_repo == '' || inputs.checkout_repo == github.repository) && inputs.merge_queue == false
147150
env:
148151
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
149152
CF_URL: ${{ steps.cloudflare.outputs.url }}
@@ -180,7 +183,7 @@ jobs:
180183
-f log_url="https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
181184
182185
- name: 💬 Comment with the build link
183-
if: github.event_name != 'pull_request' && github.event_name != 'merge_group'
186+
if: github.event_name != 'pull_request' && inputs.merge_queue == false
184187
env:
185188
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
186189
CF_URL: ${{ steps.cloudflare.outputs.url }}
@@ -204,7 +207,7 @@ jobs:
204207
-H "Accept: application/vnd.github+json" \
205208
repos/${{ github.repository }}/commits/$(git rev-parse HEAD)/comments \
206209
-f body="$COMMENT_BODY"
207-
elif [ "${{ github.event_name }}" != "pull_request" ] && [ "${{ github.event_name }}" != "merge_group" ]; then
210+
elif [ "${{ github.event_name }}" != "pull_request" ]; then
208211
# Manual trigger (workflow_dispatch, !build): comment on the PR
209212
PR_NUMBER="${{ inputs.pr_number }}"
210213
if [ -z "$PR_NUMBER" ]; then
@@ -226,7 +229,7 @@ jobs:
226229
run: sed -i "s|$TEMPLATE||" frontend/dist/index.html
227230

228231
- name: 📦 Upload web bundle artifact
229-
if: github.event_name != 'pull_request'
232+
if: github.event_name != 'pull_request' && inputs.merge_queue == false
230233
uses: actions/upload-artifact@v6
231234
with:
232235
name: graphite-web-bundle

.github/workflows/check.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ jobs:
2929
secrets: inherit
3030
with:
3131
web: true
32+
merge_queue: ${{ github.event_name == 'merge_group' }}
3233

3334
# Run the Rust tests on the self-hosted native runner
3435
test:

0 commit comments

Comments
 (0)