Skip to content

ci: Harden workflows with least-privilege permissions and per-PR concurrency#517

Merged
aanm merged 1 commit into
mainfrom
pr/HadrienPatte/ci-lint
Jul 2, 2026
Merged

ci: Harden workflows with least-privilege permissions and per-PR concurrency#517
aanm merged 1 commit into
mainfrom
pr/HadrienPatte/ci-lint

Conversation

@HadrienPatte

Copy link
Copy Markdown
Member

Add an explicit top-level permissions: contents: read block to both workflows so the GITHUB_TOKEN no longer inherits the repo/org default (potentially read-write). Neither workflow need github write level permissions, image pushed are authenticated to quay.io, all that's needed from github is read-only to checkout the source.

Add a per-PR concurrency group that cancels superseded in-progress runs. The group is keyed on github.ref so each PR (and main) is isolated, and cancel-in-progress is gated on event_name == 'pull_request' so push-to-main release builds always run to completion.

…urrency

Add an explicit top-level `permissions: contents: read` block to both
workflows so the GITHUB_TOKEN no longer inherits the repo/org default
(potentially read-write). Neither workflow need github write level
permissions, image pushed are authenticated to quay.io, all that's
needed from github is read-only to checkout the source.

Add a per-PR concurrency group that cancels superseded in-progress runs.
The group is keyed on github.ref so each PR (and main) is isolated, and
cancel-in-progress is gated on `event_name == 'pull_request'` so
push-to-main release builds always run to completion.

Signed-off-by: Hadrien Patte <hadrien.patte@datadoghq.com>
@HadrienPatte
HadrienPatte requested review from a team as code owners July 2, 2026 14:30
@aanm
aanm merged commit e209649 into main Jul 2, 2026
11 checks passed
@aanm
aanm deleted the pr/HadrienPatte/ci-lint branch July 2, 2026 15:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants