chore: Enhance CI workflow concurrency management for push and PR events
Some checks failed
CI / skip-ci-check (push) Successful in 1m28s
CI / skip-ci-check (pull_request) Successful in 1m29s
CI / lint-and-type-check (push) Successful in 2m6s
CI / test-backend (push) Has been cancelled
CI / build (push) Has been cancelled
CI / secret-scanning (push) Has been cancelled
CI / dependency-scan (push) Has been cancelled
CI / sast-scan (push) Has been cancelled
CI / workflow-summary (push) Has been cancelled
CI / python-lint (push) Has been cancelled
CI / python-lint (pull_request) Has been cancelled
CI / test-backend (pull_request) Has been cancelled
CI / build (pull_request) Has been cancelled
CI / secret-scanning (pull_request) Has been cancelled
CI / dependency-scan (pull_request) Has been cancelled
CI / sast-scan (pull_request) Has been cancelled
CI / workflow-summary (pull_request) Has been cancelled
CI / lint-and-type-check (pull_request) Has been cancelled
Some checks failed
CI / skip-ci-check (push) Successful in 1m28s
CI / skip-ci-check (pull_request) Successful in 1m29s
CI / lint-and-type-check (push) Successful in 2m6s
CI / test-backend (push) Has been cancelled
CI / build (push) Has been cancelled
CI / secret-scanning (push) Has been cancelled
CI / dependency-scan (push) Has been cancelled
CI / sast-scan (push) Has been cancelled
CI / workflow-summary (push) Has been cancelled
CI / python-lint (push) Has been cancelled
CI / python-lint (pull_request) Has been cancelled
CI / test-backend (pull_request) Has been cancelled
CI / build (pull_request) Has been cancelled
CI / secret-scanning (pull_request) Has been cancelled
CI / dependency-scan (pull_request) Has been cancelled
CI / sast-scan (pull_request) Has been cancelled
CI / workflow-summary (pull_request) Has been cancelled
CI / lint-and-type-check (pull_request) Has been cancelled
This commit updates the CI workflow to improve concurrency management by grouping runs based on branch name and commit SHA. It ensures that push and PR events for the same branch and commit are handled together, preventing duplicate executions. Additionally, it clarifies comments regarding the handling of events, enhancing the overall clarity and efficiency of the CI process.
This commit is contained in:
parent
16e5d4acaf
commit
45ceedc250
@ -15,13 +15,13 @@ on:
|
||||
# Prevent duplicate runs when pushing to a branch with an open PR
|
||||
# This ensures only one workflow runs at a time for the same commit
|
||||
concurrency:
|
||||
# Use commit SHA to unify push and PR events for the same commit
|
||||
# Use commit SHA and branch to unify push and PR events for the same commit
|
||||
# This prevents duplicate runs when both push and PR events fire for the same commit
|
||||
# For PRs: uses head SHA (the commit being tested)
|
||||
# For pushes: uses the commit SHA from the push event (github.event.after or github.sha)
|
||||
# The group name combines workflow name with commit SHA to ensure uniqueness
|
||||
# If both push and PR events fire for the same commit, only one will run
|
||||
group: ${{ github.workflow }}-${{ github.event.pull_request.head.sha || github.event.after || github.sha }}
|
||||
# For PRs: uses base branch (target) and head SHA (the commit being tested)
|
||||
# For pushes: uses branch name and commit SHA from the push event
|
||||
# The group ensures push and PR events for the same branch+commit are grouped together
|
||||
# If both push and PR events fire for the same commit on the same branch, only one will run
|
||||
group: ${{ github.workflow }}-${{ github.event.pull_request.base.ref || github.ref_name }}-${{ github.event.pull_request.head.sha || github.event.after || github.sha }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
@ -65,6 +65,8 @@ jobs:
|
||||
echo "Skipping CI: Push event on feature branch '$BRANCH_NAME' (use PR events instead)"
|
||||
SKIP=1
|
||||
fi
|
||||
# Note: For dev/master, we rely on concurrency group to prevent duplicates
|
||||
# If both push and PR events fire, concurrency will cancel one
|
||||
fi
|
||||
|
||||
# Check branch name (case-insensitive)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user