Fix CI failing on PRs reaching master via the merge queue

This commit is contained in:
Keavon Chambers 2026-03-22 00:10:55 -07:00
parent 342160b803
commit b7a1b3e665
2 changed files with 8 additions and 4 deletions

View File

@ -46,6 +46,8 @@ on:
type: string
pr_number:
type: string
merge_queue:
type: boolean
jobs:
web:
@ -111,6 +113,7 @@ jobs:
run: mold -run cargo run build web${{ inputs.debug && ' debug' || '' }}
- name: 📤 Publish to Cloudflare Pages
if: inputs.merge_queue == false
id: cloudflare
continue-on-error: ${{ github.event_name != 'push' }}
env:
@ -143,7 +146,7 @@ jobs:
exit 1
- name: 🚀 Create a GitHub environment deployment
if: inputs.checkout_repo == '' || inputs.checkout_repo == github.repository
if: (inputs.checkout_repo == '' || inputs.checkout_repo == github.repository) && inputs.merge_queue == false
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CF_URL: ${{ steps.cloudflare.outputs.url }}
@ -180,7 +183,7 @@ jobs:
-f log_url="https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
- name: 💬 Comment with the build link
if: github.event_name != 'pull_request' && github.event_name != 'merge_group'
if: github.event_name != 'pull_request' && inputs.merge_queue == false
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CF_URL: ${{ steps.cloudflare.outputs.url }}
@ -204,7 +207,7 @@ jobs:
-H "Accept: application/vnd.github+json" \
repos/${{ github.repository }}/commits/$(git rev-parse HEAD)/comments \
-f body="$COMMENT_BODY"
elif [ "${{ github.event_name }}" != "pull_request" ] && [ "${{ github.event_name }}" != "merge_group" ]; then
elif [ "${{ github.event_name }}" != "pull_request" ]; then
# Manual trigger (workflow_dispatch, !build): comment on the PR
PR_NUMBER="${{ inputs.pr_number }}"
if [ -z "$PR_NUMBER" ]; then
@ -226,7 +229,7 @@ jobs:
run: sed -i "s|$TEMPLATE||" frontend/dist/index.html
- name: 📦 Upload web bundle artifact
if: github.event_name != 'pull_request'
if: github.event_name != 'pull_request' && inputs.merge_queue == false
uses: actions/upload-artifact@v6
with:
name: graphite-web-bundle

View File

@ -29,6 +29,7 @@ jobs:
secrets: inherit
with:
web: true
merge_queue: ${{ github.event_name == 'merge_group' }}
# Run the Rust tests on the self-hosted native runner
test: