Skip to content
15 changes: 15 additions & 0 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,21 @@ on:
schedule:
- cron: '17 9 * * 5'

# Avoid duplicate runs for the same source branch and repository.
# For pull_request events, uses the source repo name from
# github.event.pull_request.head.repo.full_name; otherwise uses github.repository.
# For push events, uses the branch name from github.ref_name.
# For pull_request events, uses the source branch name from github.head_ref.
# This ensures events for the same repo and branch share the same group,
# and avoids cross-fork collisions when branch names are reused.
# Schedule events are not cancelled to ensure weekly scans complete.
concurrency:
group: >-
${{ github.workflow }}-${{
github.event.pull_request.head.repo.full_name || github.repository
}}-${{ github.head_ref || github.ref_name }}
cancel-in-progress: ${{ github.event_name != 'schedule' }}

jobs:
analyze:
name: Analyze
Expand Down
14 changes: 14 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,20 @@ on:
- '**.yml'
- 'docs/**'

# Avoid duplicate runs for the same source branch and repository.
# For pull_request events, uses the source repo name from
# github.event.pull_request.head.repo.full_name; otherwise uses github.repository.
# For push events, uses the branch name from github.ref_name.
# For pull_request events, uses the source branch name from github.head_ref.
# This ensures events for the same repo and branch share the same group,
# and avoids cross-fork collisions when branch names are reused.
concurrency:
group: >-
${{ github.workflow }}-${{
github.event.pull_request.head.repo.full_name || github.repository
}}-${{ github.head_ref || github.ref_name }}
cancel-in-progress: true

jobs:
ruff:
runs-on: ubuntu-latest
Expand Down
15 changes: 15 additions & 0 deletions .github/workflows/pypi-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,21 @@ on:
types: [published] # "Publish release" button
workflow_dispatch: # Manual trigger to test wheel build

# Avoid duplicate runs for the same source branch and repository.
# For pull_request events, uses the source repo name from
# github.event.pull_request.head.repo.full_name; otherwise uses github.repository.
# For push events, uses the branch name from github.ref_name.
# For pull_request events, uses the source branch name from github.head_ref.
# This ensures events for the same repo and branch share the same group,
# and avoids cross-fork collisions when branch names are reused.
# Also applies to release (uses tag name) and workflow_dispatch (uses branch/tag name).
concurrency:
group: >-
${{ github.workflow }}-${{
github.event.pull_request.head.repo.full_name || github.repository
}}-${{ github.head_ref || github.ref_name }}
cancel-in-progress: true

jobs:
echo_github_env:
name: Echo env variables
Expand Down
14 changes: 14 additions & 0 deletions .github/workflows/unittest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,20 @@ on:
- "MANIFEST.in"
- "pyproject.toml"

# Avoid duplicate runs for the same source branch and repository.
# For pull_request events, uses the source repo name from
# github.event.pull_request.head.repo.full_name; otherwise uses github.repository.
# For push events, uses the branch name from github.ref_name.
# For pull_request events, uses the source branch name from github.head_ref.
# This ensures events for the same repo and branch share the same group,
# and avoids cross-fork collisions when branch names are reused.
concurrency:
group: >-
${{ github.workflow }}-${{
github.event.pull_request.head.repo.full_name || github.repository
}}-${{ github.head_ref || github.ref_name }}
cancel-in-progress: true

jobs:
unittest:
strategy:
Expand Down
Loading