From 08ab83b51f30e555a93d8ecb3f00ce8aa5ac6b5c Mon Sep 17 00:00:00 2001 From: Tejas Kashinath Date: Tue, 3 Mar 2026 17:32:03 -0500 Subject: [PATCH] fix: prevent CI runs from cancelling each other on main MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change cancel-in-progress from unconditional `true` to `${{ github.ref != 'refs/heads/main' }}` in codeql, build-and-test, and lint workflows. This prevents back-to-back merges from cancelling each other's runs on main while still cancelling superseded PR runs. Also remove stale `feat/gateway-integration` branch from all workflow triggers — the branch was merged and deleted. --- .github/workflows/build-and-test.yml | 8 ++++---- .github/workflows/codeql.yml | 10 +++++----- .github/workflows/e2e-tests.yml | 2 +- .github/workflows/lint.yml | 8 ++++---- .github/workflows/pr-size.yml | 2 +- .github/workflows/pr-title.yml | 2 +- 6 files changed, 16 insertions(+), 16 deletions(-) diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index 6ad7f53a..d1e1c1e4 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -2,17 +2,17 @@ name: Build and Test on: push: - branches: ['main', 'feat/gateway-integration'] + branches: ['main'] pull_request: - branches: ['main', 'feat/gateway-integration'] + branches: ['main'] permissions: contents: read -# Cancel in-progress runs when a new commit is pushed +# Cancel in-progress runs for PRs; never cancel runs on main (merges should not abort each other) concurrency: group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true + cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} jobs: build: diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index a64f5bb3..e5a49cc3 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -2,16 +2,16 @@ name: CodeQL on: push: - branches: ['main', 'feat/gateway-integration'] + branches: ['main'] pull_request: - branches: ['main', 'feat/gateway-integration'] + branches: ['main'] pull_request_target: - branches: ['main', 'feat/gateway-integration'] + branches: ['main'] -# Cancel in-progress runs when a new commit is pushed +# Cancel in-progress runs for PRs; never cancel runs on main (merges should not abort each other) concurrency: group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true + cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} jobs: analyze: diff --git a/.github/workflows/e2e-tests.yml b/.github/workflows/e2e-tests.yml index a07a3d83..99c9540b 100644 --- a/.github/workflows/e2e-tests.yml +++ b/.github/workflows/e2e-tests.yml @@ -6,7 +6,7 @@ on: description: 'AWS region for deployment' default: 'us-east-1' pull_request_target: - branches: [main, feat/gateway-integration] + branches: [main] concurrency: group: e2e-${{ github.event.pull_request.number || github.ref }} diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index ee7b103e..51607f2a 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -2,17 +2,17 @@ name: Quality and Safety Checks on: push: - branches: ['main', 'feat/gateway-integration'] + branches: ['main'] pull_request: - branches: ['main', 'feat/gateway-integration'] + branches: ['main'] permissions: contents: read -# Cancel in-progress runs when a new commit is pushed +# Cancel in-progress runs for PRs; never cancel runs on main (merges should not abort each other) concurrency: group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true + cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} jobs: setup: diff --git a/.github/workflows/pr-size.yml b/.github/workflows/pr-size.yml index e172e99f..1982c05f 100644 --- a/.github/workflows/pr-size.yml +++ b/.github/workflows/pr-size.yml @@ -4,7 +4,7 @@ name: PR Size Check and Label # Safe because this workflow only reads PR metadata — it never checks out untrusted code. on: pull_request_target: - branches: [main, feat/gateway-integration] + branches: [main] jobs: label-size: diff --git a/.github/workflows/pr-title.yml b/.github/workflows/pr-title.yml index 77029497..3ab97639 100644 --- a/.github/workflows/pr-title.yml +++ b/.github/workflows/pr-title.yml @@ -2,7 +2,7 @@ name: Validate PR Title on: pull_request_target: - branches: [main, feat/gateway-integration] + branches: [main] types: [opened, edited, synchronize, reopened] permissions: