Skip to content

ci: pass release workflow_dispatch inputs through env - #15994

Open
WAHIB-EL-KHADIRI wants to merge 1 commit into
dbt-labs:mainfrom
WAHIB-EL-KHADIRI:ci/quote-release-workflow-inputs
Open

ci: pass release workflow_dispatch inputs through env#15994
WAHIB-EL-KHADIRI wants to merge 1 commit into
dbt-labs:mainfrom
WAHIB-EL-KHADIRI:ci/quote-release-workflow-inputs

Conversation

@WAHIB-EL-KHADIRI

Copy link
Copy Markdown

resolves

Problem

release.yml expands workflow_dispatch inputs directly into shell bodies in two steps.

[DEBUG] Print Variables — unquoted:

echo The branch to release from:         ${{ inputs.target_branch }}
echo The release version number:         ${{ inputs.version_number }}

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. The echo step 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 env and quote them.

The hatch check also now reads MIN_HATCH_VERSION directly rather than through ${{ env.MIN_HATCH_VERSION }} — a workflow-level env: entry is already a real environment variable inside a run step, so re-expanding it added an expansion without adding anything.

Behaviour is unchanged for every well-formed input: the same strings reach the same sed pipeline and the same echo output.

Checklist

  • I have read the contributing guide and understand what's expected of me.
  • I have run this code in development, and it appears to resolve the stated issue.
  • This PR includes tests, or tests are not required or relevant for this PR.
  • This PR has no interface changes (e.g. macros, cli, logs, json artifacts, config files, adapter interface, etc.) or this PR has already received feedback and approval from Product or DX.

Verification

Workflow files carry no tests, so instead:

  • zizmor --min-severity high on release.yml: template-injection findings 0, down from 3. No other finding in the file changed.
  • Parsed with PyYAML: still 10 jobs, and both edited steps carry the expected env keys (TARGET_BRANCH, VERSION_NUMBER, TEST_RUN, NIGHTLY_RELEASE, ONLY_DOCKER on the debug step; VERSION_NUMBER on the hatch check).
  • Confirmed the pushed file is byte-identical to the one those checks ran against.

I could not execute the workflow — it is workflow_dispatch and publishes releases, so triggering it is not something I can or should do from a fork.

Not included

zizmor also flags four sites in test-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.

@WAHIB-EL-KHADIRI
WAHIB-EL-KHADIRI requested a review from a team as a code owner August 19, 2026 12:11
@cla-bot

cla-bot Bot commented Aug 19, 2026

Copy link
Copy Markdown

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

codescene-delta-analysis[bot]

This comment was marked as outdated.

@WAHIB-EL-KHADIRI

Copy link
Copy Markdown
Author

@cla-bot check

The Individual CLA has been submitted for GitHub account WAHIB-EL-KHADIRI.

@cla-bot cla-bot Bot added the cla:yes label Aug 19, 2026
@cla-bot

cla-bot Bot commented Aug 19, 2026

Copy link
Copy Markdown

The cla-bot has been summoned, and re-checked this pull request!

@WAHIB-EL-KHADIRI
WAHIB-EL-KHADIRI force-pushed the ci/quote-release-workflow-inputs branch from 37de7cf to c5c2f97 Compare August 19, 2026 12:48
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>
codescene-delta-analysis[bot]

This comment was marked as outdated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant