Skip to content

Commit 0d6fc31

Browse files
authored
fix: prevent CI runs from cancelling each other on main (#492)
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.
1 parent 8c8b179 commit 0d6fc31

File tree

6 files changed

+16
-16
lines changed

6 files changed

+16
-16
lines changed

.github/workflows/build-and-test.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,17 @@ name: Build and Test
22

33
on:
44
push:
5-
branches: ['main', 'feat/gateway-integration']
5+
branches: ['main']
66
pull_request:
7-
branches: ['main', 'feat/gateway-integration']
7+
branches: ['main']
88

99
permissions:
1010
contents: read
1111

12-
# Cancel in-progress runs when a new commit is pushed
12+
# Cancel in-progress runs for PRs; never cancel runs on main (merges should not abort each other)
1313
concurrency:
1414
group: ${{ github.workflow }}-${{ github.ref }}
15-
cancel-in-progress: true
15+
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
1616

1717
jobs:
1818
build:

.github/workflows/codeql.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,16 @@ name: CodeQL
22

33
on:
44
push:
5-
branches: ['main', 'feat/gateway-integration']
5+
branches: ['main']
66
pull_request:
7-
branches: ['main', 'feat/gateway-integration']
7+
branches: ['main']
88
pull_request_target:
9-
branches: ['main', 'feat/gateway-integration']
9+
branches: ['main']
1010

11-
# Cancel in-progress runs when a new commit is pushed
11+
# Cancel in-progress runs for PRs; never cancel runs on main (merges should not abort each other)
1212
concurrency:
1313
group: ${{ github.workflow }}-${{ github.ref }}
14-
cancel-in-progress: true
14+
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
1515

1616
jobs:
1717
analyze:

.github/workflows/e2e-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66
description: 'AWS region for deployment'
77
default: 'us-east-1'
88
pull_request_target:
9-
branches: [main, feat/gateway-integration]
9+
branches: [main]
1010

1111
concurrency:
1212
group: e2e-${{ github.event.pull_request.number || github.ref }}

.github/workflows/lint.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,17 @@ name: Quality and Safety Checks
22

33
on:
44
push:
5-
branches: ['main', 'feat/gateway-integration']
5+
branches: ['main']
66
pull_request:
7-
branches: ['main', 'feat/gateway-integration']
7+
branches: ['main']
88

99
permissions:
1010
contents: read
1111

12-
# Cancel in-progress runs when a new commit is pushed
12+
# Cancel in-progress runs for PRs; never cancel runs on main (merges should not abort each other)
1313
concurrency:
1414
group: ${{ github.workflow }}-${{ github.ref }}
15-
cancel-in-progress: true
15+
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
1616

1717
jobs:
1818
setup:

.github/workflows/pr-size.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ name: PR Size Check and Label
44
# Safe because this workflow only reads PR metadata — it never checks out untrusted code.
55
on:
66
pull_request_target:
7-
branches: [main, feat/gateway-integration]
7+
branches: [main]
88

99
jobs:
1010
label-size:

.github/workflows/pr-title.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: Validate PR Title
22

33
on:
44
pull_request_target:
5-
branches: [main, feat/gateway-integration]
5+
branches: [main]
66
types: [opened, edited, synchronize, reopened]
77

88
permissions:

0 commit comments

Comments
 (0)