Skip to content

Pass workflow expressions to run steps through env - #2961

Merged
bitsandfoxes merged 1 commit into
mainfrom
fix/workflow-template-injection
Nov 25, 2026
Merged

bitsandfoxes merged 1 commit into
mainfrom
fix/workflow-template-injection

Conversation

@sentry-junior

@sentry-junior sentry-junior Bot commented Nov 25, 2026

Copy link
Copy Markdown
Contributor

#skip-changelog

Several workflow steps put ${{ }} expressions directly into run: scripts, a pattern that the run-shell-injection and template-injection rules flag. This change moves each value into env: and reads it from the environment in the script.

None of these values is attacker-controlled today. unity-version comes from the static lists in create-unity-matrix.yml, or from a [0-9]+\.[0-9]+ capture on chore/unity-* branch names. The reusable workflows still shouldn't rely on their callers to keep it that way. The update-deps.yml step is the one case that takes data from outside the repo: the version and changeset returned by Unity's releases API.

Some steps get an explicit shell: so they behave the same on every runner:

  • sdk.yml "Update submodules" now runs in bash, like the "Get submodule status" step above it, so $SUBMODULES is split into words on the Windows runners too.
  • sdk.yml "Build" now runs in pwsh and reads the target from $env:TARGET.

update-deps.yml only runs on a schedule or workflow_dispatch, and the sdk.yml "Build" step only runs on a native SDK cache miss. Watch those two after merge.

via amir.

--

View Session [Sentry]

Co-Authored-By: Amir Mujacic <amir.mujacic@sentry.io>
@mujacica
mujacica marked this pull request as ready for review November 25, 2026 09:20
@bitsandfoxes
bitsandfoxes merged commit fcd5f3c into main Nov 25, 2026
78 checks passed
@bitsandfoxes
bitsandfoxes deleted the fix/workflow-template-injection branch November 25, 2026 10:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant