diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 34ca89a6..981fc7f8 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -24,6 +24,9 @@ concurrency: jobs: build: uses: docker/github-builder/.github/workflows/build.yml@v1 + # Exclude 'push' events from the Merge Queue to avoid a race condition where + # the 'push' event might cancel the 'merge_group' event via the concurrency group. + if: (!(github.event_name == 'push' && startsWith(github.ref, 'refs/heads/gh-readonly-queue/'))) permissions: contents: read packages: write diff --git a/.github/workflows/oxipng.yml b/.github/workflows/oxipng.yml index 9a7d669e..e8dc31df 100644 --- a/.github/workflows/oxipng.yml +++ b/.github/workflows/oxipng.yml @@ -19,8 +19,14 @@ jobs: runs-on: ${{ matrix.os }} timeout-minutes: 60 - # Prevent tags and in-repo PRs from triggering this workflow more than once for a commit - if: github.ref_type != 'tag' && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.fork) + # Prevent tags and in-repo PRs from triggering this workflow more than once for a commit. + # We also exclude 'push' events from the Merge Queue (gh-readonly-queue/) because they + # trigger alongside the 'merge_group' event. Without this, a race condition in the + # concurrency group could cause the 'push' event to cancel the 'merge_group' event. + if: >- + github.ref_type != 'tag' && + (github.event_name != 'pull_request' || github.event.pull_request.head.repo.fork) && + (!(github.event_name == 'push' && startsWith(github.ref, 'refs/heads/gh-readonly-queue/'))) strategy: fail-fast: false @@ -154,8 +160,14 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 30 - # Prevent tags and in-repo PRs from triggering this workflow more than once for a commit - if: github.ref_type != 'tag' && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.fork) + # Prevent tags and in-repo PRs from triggering this workflow more than once for a commit. + # We also exclude 'push' events from the Merge Queue (gh-readonly-queue/) because they + # trigger alongside the 'merge_group' event. Without this, a race condition in the + # concurrency group could cause the 'push' event to cancel the 'merge_group' event. + if: >- + github.ref_type != 'tag' && + (github.event_name != 'pull_request' || github.event.pull_request.head.repo.fork) && + (!(github.event_name == 'push' && startsWith(github.ref, 'refs/heads/gh-readonly-queue/'))) steps: - name: Checkout source