fix: pin 1 actions to commit SHA, extract 1 expressions to env vars#3457
Open
dagecko wants to merge 1 commit intoiluwatar:masterfrom
Open
fix: pin 1 actions to commit SHA, extract 1 expressions to env vars#3457dagecko wants to merge 1 commit intoiluwatar:masterfrom
dagecko wants to merge 1 commit intoiluwatar:masterfrom
Conversation
PR SummaryPins GitHub Actions to immutable commit SHAs instead of version tags, and extracts an expression from a run block into an environment variable. Specifically, upgrades the presubmit workflow to replace 'latest' with a pinned commit for the action Changes
autogenerated by presubmit.ai |
There was a problem hiding this comment.
✅ LGTM!
Review Summary
Commits Considered (1)
- 1c77ddb: fix: pin 1 actions to commit SHA, extract 1 expressions to env vars
Files Processed (1)
- .github/workflows/presubmit.yml (1 hunk)
Actionable Comments (0)
Skipped Comments (2)
-
.github/workflows/presubmit.yml [24-25]
readability: "YAML indentation and env scoping for secret check"
-
.github/workflows/presubmit.yml [26-29]
best_practice: "Pinning and env propagation for action step"
|
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.



Re-submission of #3455. Had a problem with my fork and had to delete it, which closed the original PR. Apologies for the noise.
Summary
This PR pins all GitHub Actions to immutable commit SHAs instead of mutable version tags and extracts expressions from
run:blocks intoenv:mappings.Changes by file
A note on internal action pinning
This PR pins all actions including org-owned ones. Best practice is to pin everything — the tj-actions/changed-files attack was an internally maintained action that was compromised, and every repo referencing it by tag silently executed attacker code. That said, it's your codebase. If you'd prefer to leave org-owned actions unpinned, let us know and we'll adjust the PR.
How to verify
Review the diff — each change is mechanical and preserves workflow behavior:
action@v3becomesaction@abc123 # v3— original version preserved as comment${{ expr }}inrun:moves toenv:block, referenced as$ENV_VARin the scriptI wrote a scanner called Runner Guard and open sourced it here.
If you have any questions, reach out. I'll be monitoring comms.
- Chris Nyhuis (dagecko)