ci: pass release workflow_dispatch inputs through env - #15994
Open
WAHIB-EL-KHADIRI wants to merge 1 commit into
Open
ci: pass release workflow_dispatch inputs through env#15994WAHIB-EL-KHADIRI wants to merge 1 commit into
WAHIB-EL-KHADIRI wants to merge 1 commit into
Conversation
|
Thanks for your pull request, and welcome to our community! We require contributors to sign our Contributor License Agreement and we don't seem to have your signature on file. Check out this article for more information on why we have a CLA. In order for us to review and merge your code, please submit the Individual Contributor License Agreement form attached above above. If you have questions about the CLA, or if you believe you've received this message in error, please reach out through a comment on this PR. CLA has not been signed by users: @WAHIB-EL-KHADIRI |
Author
|
@cla-bot check The Individual CLA has been submitted for GitHub account |
|
The cla-bot has been summoned, and re-checked this pull request! |
WAHIB-EL-KHADIRI
force-pushed
the
ci/quote-release-workflow-inputs
branch
from
August 19, 2026 12:48
37de7cf to
c5c2f97
Compare
release.yml expanded dispatch inputs directly into shell bodies in two
steps: an unquoted echo of the inputs, and a command substitution feeding
the hatch version check.
A ${{ ... }} expression is substituted as text before bash parses the line,
so the input is not a value being read - it becomes part of the program.
Both steps now read the values from env and quote them.
The hatch check also reads MIN_HATCH_VERSION directly, since a
workflow-level env: entry is already a real environment variable inside a
run step and did not need re-expanding.
Behaviour is unchanged for every well-formed input.
Verified: zizmor reports 0 template-injection findings in release.yml, down
from 3, and the file parses with the same 10 jobs.
Co-Authored-By: Claude Opus 5 <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.
resolves
Problem
release.ymlexpandsworkflow_dispatchinputs directly into shell bodies in two steps.[DEBUG] Print Variables— unquoted:Check if using hatch— inside a command substitution:INPUT_MAJ_MIN=$(echo "${{ inputs.version_number }}" | sed -E 's/^([0-9]+\.[0-9]+).*/\1/')A
${{ ... }}expression is substituted as text before bash parses the line, so the input is not a value being read — it becomes part of the program. Theechostep compounds it by being unquoted, so an input containing whitespace or a;does not merely print oddly.Dispatching a release needs write access, so this is not reachable by an outside party. It matters because of where it sits: this is the workflow that publishes to GitHub, PyPI and Docker, and it runs after a human has clicked "Run workflow" and looked away.
Solution
Both steps read the values from
envand quote them.The hatch check also now reads
MIN_HATCH_VERSIONdirectly rather than through${{ env.MIN_HATCH_VERSION }}— a workflow-levelenv:entry is already a real environment variable inside arunstep, so re-expanding it added an expansion without adding anything.Behaviour is unchanged for every well-formed input: the same strings reach the same
sedpipeline and the sameechooutput.Checklist
Verification
Workflow files carry no tests, so instead:
zizmor --min-severity highonrelease.yml:template-injectionfindings 0, down from 3. No other finding in the file changed.envkeys (TARGET_BRANCH,VERSION_NUMBER,TEST_RUN,NIGHTLY_RELEASE,ONLY_DOCKERon the debug step;VERSION_NUMBERon the hatch check).I could not execute the workflow — it is
workflow_dispatchand publishes releases, so triggering it is not something I can or should do from a fork.Not included
zizmoralso flags four sites intest-repeater.yml, same class, also dispatch inputs. That is a debug/CI helper rather than the release path, and I kept this PR to one file. Happy to open it separately.Note
Prepared with assistance from Claude (Anthropic). The finding, the scope decision, and each verification step above I checked myself before opening this.