Skip to content

Commit 88a0724

Browse files
Limit cancel-in-progress for CI to pull requests only (#837)
### What Make cancel-in-progress conditional on pull request events in the CI workflow concurrency configuration. ### Why This ensures every commit on protected branches like main runs to completion while still canceling redundant builds on pull requests. On the main branch builds run for two reasons: pushes, and scheduled runs. Pushes build most images, and scheduled runs build only nightly images. @sisuresh noticed that the main scheduled runs ([eg](https://github.com/stellar/quickstart/actions/runs/19745699438)) are causing the push runs to be canceled because they run for the same commit. It's a good thing that the workflow causes the push and scheduled builds on the main branch to be serialised so only one runs at a time. But a scheduled build shouldn't cancel a push build.
1 parent ae00478 commit 88a0724

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ on:
2727
# main, where a build for every commit will run.
2828
concurrency:
2929
group: ${{ github.workflow }}-${{ github.ref_protected == true && github.sha || github.ref }}
30-
cancel-in-progress: true
30+
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
3131

3232
jobs:
3333

0 commit comments

Comments
 (0)