Harden CI workflow security#1599
Open
Alb3e3 wants to merge 1 commit into
Open
Conversation
ammarfaizi2
suggested changes
Jun 11, 2026
ammarfaizi2
left a comment
Contributor
There was a problem hiding this comment.
I am okay with the changes, but as always, please follow the pull request guidelines.
- The explanation should be included in the commit message and word-wrapped at 72 characters.
- The commit must contain a
Signed-off-bytag.
Limit the workflow token for the CI workflow to read-only contents access. The job only needs repository reads, so the default write-capable token is broader than necessary. Also avoid direct GitHub expression interpolation in the shell command that builds the commit list. The generated matrix values are passed through environment variables and quoted before checkout so the shell does not evaluate attacker-controlled pull request metadata. Signed-off-by: Alb3e3 <74142887+Alb3e3@users.noreply.github.com>
c1f6eeb to
500c7b4
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This tightens the CI workflow security posture without changing the build matrix itself.
I verified the workflow YAML still parses,
git diff --checkpasses, andzizmorno longer reports the previous excessive-permissions or template-injection findings for this workflow. The remainingzizmorfindings are action pinning warnings, which I left out of this focused change.