Skip to content

Commit 54b9dda

Browse files
dahliaclaude
andcommitted
Fix workflow concurrency to prevent PR builds from cancelling main builds
Previously, PR builds and main branch push builds shared the same concurrency group because pull_request_target events use the base branch ref. This caused PR builds to cancel ongoing main builds. Now PR builds use a unique concurrency group (pr-<number>) while push builds continue to use the branch ref, preventing interference. Co-Authored-By: Claude <[email protected]>
1 parent f3246d7 commit 54b9dda

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

.github/workflows/build.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: build
22
on: [push, pull_request_target]
33

44
concurrency:
5-
group: ${{ github.workflow }}-${{ github.ref }}
5+
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request_target' && format('pr-{0}', github.event.pull_request.number) || github.ref }}
66
cancel-in-progress: true
77

88
jobs:

0 commit comments

Comments
 (0)