ci: route release create-release-tag shell through env, not shell interpolation - #12229
Merged
Merged
Conversation
|
@camgrimsec is attempting to deploy a commit to the deepset Team on Vercel. A member of the Team first needs to authorize it. |
Contributor
|
Hi @camgrimsec, thanks for your interest in contributing to Haystack! 🙏 This is an automated message to help us keep the review queue healthy. |
6 tasks
…erpolation
The Update VERSION.txt and create tag step in the release workflow ran
git checkout, git pull, git commit, git push, and git tag with
${{ needs.parse-validate-version.outputs.version }} and ${{ needs.parse-validate-version.outputs.release_branch }}
interpolated directly into the shell body.
Values come from .github/utils/parse_validate_version.sh, but any change
to that script (or its inputs) that let a metacharacter through would
land as a shell token in a step that already runs with a token scoped
to contents: write and secrets.HAYSTACK_BOT_TOKEN. GitHub's own
security-hardening guide flags this as a script-injection pattern and
recommends passing the values through env: so the shell sees them as
opaque strings.
Change:
- Add VERSION and RELEASE_BRANCH to the step's env: block
- Replace every ${{ ... }} in the run: body with quoted "$VERSION" and
"$RELEASE_BRANCH"
Behavior is identical: the commit message, tag, and pushed branch are
the same strings the script would have produced before. Same env-var
pattern already merged in deepset-ai#11856 (release-notes reST check) and deepset-ai#11857
(release version input).
julian-risch
approved these changes
Aug 4, 2026
julian-risch
left a comment
Member
There was a problem hiding this comment.
Looks good to me! Thank you for your contribution!
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.
Proposed change
Follow-up in the same style as #11856 (release-notes reST check) and #11857 (release version input): route
${{ ... }}expressions in thecreate-release-tagjob ofrelease.ymlthrough the step'senv:block so the shell body works with plain variables instead of textual template expansion.Before
After
Six direct
${{ needs.parse-validate-version.outputs.* }}expansions inside the shell body become twoenv:bindings plus normal shell variables.Why
The
versionandrelease_branchvalues are produced by.github/utils/parse_validate_version.shand validated there, so today'screate-release-tagjob is not exploitable. That's exactly why this is a cheap change: it's the same pattern already used in therelease-notes-checkstep of the same workflow after #11856, and the same pattern applied to the top-levelinputs.versionafter #11857.The reason to keep extending it here:
secrets.HAYSTACK_BOT_TOKENand runs withcontents: write, so the blast radius of any future regression (a script tweak, a new input source, a caller invoking this job with differentneeds.*outputs) is a bot-token-authorized push tomain/ a release branch. Env-passing removes the whole class of "the validator missed a shell metacharacter" as a failure mode.${{ }}expression that flows intorun:. Zizmor / actionlint'stemplate-injectionrule flags every one of these six expansions.What is not changed
git config,git add,git tag -m "$TAG" "$TAG", andgit push origin "$TAG"are untouched — those already used shell variables.env: GITHUB_TOKEN: ${{ secrets.HAYSTACK_BOT_TOKEN }}line stays as-is.token: ${{ secrets.HAYSTACK_BOT_TOKEN }}on theactions/checkoutstep above is unchanged.release.ymlis touched.Verification
python3 -c "import yaml; yaml.safe_load(open('.github/workflows/release.yml'))"succeeds.+8,-6) in one file.${{ needs.parse-validate-version.outputs.* }}expression that previously appeared inside therun:body of this step is gone; each is now bound once at the top of the step'senv:block.Checklist
Thanks for keeping the release workflow tidy.