From b7a1b3e665cf1c9bdfa30cce3d3df537fb75cbee Mon Sep 17 00:00:00 2001 From: Keavon Chambers Date: Sun, 22 Mar 2026 00:10:55 -0700 Subject: [PATCH] Fix CI failing on PRs reaching master via the merge queue --- .github/workflows/build.yml | 11 +++++++---- .github/workflows/check.yml | 1 + 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a9542843..9742dcb6 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -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 diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index e82247bc..f8895ada 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -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: