Skip to content

Commit 070c8f7

Browse files
authored
ci: allow github action parallel run on main (on release we have 2) (#1431)
# Fix: Prevent Workflow Cancellation on Main Branch ## Problem When PRs were merged to main, the workflow was being cancelled: - PR squashed commit triggered the `Test, Build & Release` workflow - Semantic-release created a new commit with `[skip_actions]` - CodeQL workflow still ran for the semantic-release commit - GitHub Actions cancelled the PR workflow due to concurrency conflicts with message: `Canceling since a higher priority waiting request for Test, Build & Release-refs/heads/main exists` ## Solution Updated `.github/workflows/build_test_and_release.yml` concurrency configuration: ```yaml concurrency: group: build-test-release-${{ github.ref }} cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} ``` **Changes:** - Use hardcoded concurrency group name to isolate this workflow from CodeQL and other workflows - Disable `cancel-in-progress` for main branch to allow both PR merge and semantic-release commits to complete - Keep cancellation enabled for feature branches to prevent redundant runs ## Result ✅ PR merge commits complete their full workflow run (setup → test → build → release) ✅ No more workflow cancellations on main branch ✅ CodeQL and other workflows run independently without interference ## What type of PR is this? (check all applicable) - [ ] 💡 (feat) - A new feature (non-breaking change which adds functionality) - [ ] 🔄 (refactor) - Code Refactoring - A code change that neither fixes a bug nor adds a feature - [x] 🐞 (fix) - Bug Fix (non-breaking change which fixes an issue) - [ ] 🏎 (perf) - Optimization - [ ] 📄 (docs) - Documentation - Documentation only changes - [ ] 📄 (test) - Tests - Adding missing tests or correcting existing tests - [ ] ⚙️ (ci) - Continuous Integrations - Changes to our CI configuration files and scripts (example scopes: Travis, Circle, BrowserStack, SauceLabs) - [ ] ☑️ (chore) - Chores - Other changes that don't modify src or test files - [ ] ↩️ (revert) - Reverts - Reverts a previous commit(s). <!-- For a timely review/response, please avoid force-pushing additional commits if your PR already received reviews or comments. Before submitting a Pull Request, please ensure you've done the following: - 👷‍♀️ Create small PRs. In most cases this will be possible. - ✅ Provide tests for your changes. - 📝 Use descriptive commit messages (as described below). - 📗 Update any related documentation and include any relevant screenshots. Commit Message Structure (all lower-case): <type>(optional ticket number): <description> [optional body] -->
1 parent 5881a65 commit 070c8f7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

.github/workflows/build_test_and_release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ name: Test, Build & Release
33
on: push
44

55
concurrency:
6-
group: ${{ github.workflow }}-${{ github.ref }}
7-
cancel-in-progress: true
6+
group: build-test-release-${{ github.ref }}
7+
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
88

99
permissions:
1010
contents: read

0 commit comments

Comments
 (0)