Harden Build workflow: drop eval, use $GITHUB_OUTPUT (PSIRT follow-up)#60
Merged
Merged
Conversation
Follow-up to #59, addressing the remaining findings from the PSIRT review of build.yml. - Replace the deprecated `::set-output` command with the `$GITHUB_OUTPUT` environment file in the setup job's set-matrix step. GitHub deprecated `::set-output` citing output-injection concerns; the environment file is the supported, safer mechanism. Also fixes a stray trailing `}` in the emitted JSON (`...["test"]}}` -> `...["test"]}`). - Remove `eval` from the test job's run step. `eval 'lein ... ${CMD}'` re-parsed a matrix-derived variable through the shell; passing it as a normal quoted argument (`lein do clean, compile :all, "$CMD"`) removes the eval/command-injection anti-pattern. No behavior change: `matrix.cmd` is hardcoded to `test`, so both jobs run exactly as before (the matrix output is still consumed via `needs.setup.outputs.matrix`). Not in this PR: bumping action major versions (setup-java v2->v4, cache v3->v4) is a runtime-behavior change better handled by Dependabot; the actions are already SHA-pinned as of #59. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
Summary
Follow-up to #59. Addresses the two remaining findings from the PSIRT review of
.github/workflows/build.ymlthat #59 left out to keep that PR's diff scoped to action-pinning and token permissions.::set-outputwith$GITHUB_OUTPUT(setup job,set-matrixstep). GitHub deprecated::set-outputciting output-injection concerns; the$GITHUB_OUTPUTenvironment file is the supported mechanism. Also fixes a stray trailing}in the emitted JSON (...["test"]}}->...["test"]}).evalfrom the test job's run step.eval 'lein do clean, compile :all, ${CMD}'re-parsed a matrix-derived variable through the shell -- an eval/command-injection anti-pattern. Passing it as a normal quoted argument (lein do clean, compile :all, "$CMD") removes the eval.No behavior change
matrix.cmdis hardcoded totest, so both jobs run exactly as before:setupstill emits the same matrix, now via$GITHUB_OUTPUT; consumers readneeds.setup.outputs.matrixunchanged.teststill runslein do clean, compile :all, test.Findings addressed
::set-output-- FIXED (this PR).evalon a matrix-derived variable -- FIXED (this PR).Deliberately not in this PR
setup-javav2->v4,cachev3->v4): a runtime-behavior change that deserves its own CI run; better handled by Dependabot. The actions are already SHA-pinned (Harden GitHub Actions workflow (PSIRT-0328599349) #59), so the tag-mutation risk is already closed.pull_requestrunning PR code (bin/lint,project.clj): inherent to build-on-PR, not a workflow defect. Mitigated by the read-only token added in Harden GitHub Actions workflow (PSIRT-0328599349) #59; further hardening (require-approval-for-first-time-contributors) is a repo setting, not a workflow change.🤖 Generated with Claude Code