Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,13 @@ on:
tags:
- 'v*'

concurrency:
# A new push to a pull request supersedes the run already in flight, and
# nothing downstream waits on the older one. Push events are exempt: a push
# run is the record that a given commit passed, so it always finishes.
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}

jobs:
test:
name: Test
Expand Down
7 changes: 7 additions & 0 deletions .github/workflows/gitleaks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@ on:
push:
branches: [main]

concurrency:
# A new push to a pull request supersedes the run already in flight, and
# nothing downstream waits on the older one. Push events are exempt: a push
# run is the record that a given commit passed, so it always finishes.
group: ${{ github.workflow }}-${{ github.ref }}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Isolate push runs from the shared concurrency group

When three commits reach main before the first Gitleaks run finishes, all push runs share Gitleaks-refs/heads/main; setting cancel-in-progress to false preserves the running run but does not preserve the pending one, because GitHub replaces an existing pending run whenever another member of the same concurrency group is queued (GitHub's concurrency documentation). Consequently, the middle commit never runs, and the next invocation scans only its own event.before..github.sha range, so a secret introduced by the skipped commit and left untouched by the following commit can evade this workflow entirely. Use a unique group for push events while retaining the ref-based group for pull requests.

Useful? React with 👍 / 👎.

cancel-in-progress: ${{ github.event_name == 'pull_request' }}

jobs:
gitleaks:
if: ${{ !contains(github.event.pull_request.labels.*.name, 'no_gha') }}
Expand Down
Loading