Skip to content

ci: pass inputs via env: instead of templating into run blocks#48

Draft
rubydusa wants to merge 1 commit into
mainfrom
ramgos/inputs-via-env
Draft

ci: pass inputs via env: instead of templating into run blocks#48
rubydusa wants to merge 1 commit into
mainfrom
ramgos/inputs-via-env

Conversation

@rubydusa
Copy link
Copy Markdown
Contributor

Closes #42.

Summary

Sweep every workflow and convert `${{ inputs.X }}` substitutions inside `run:` blocks to the `env:` + quoted-shell-variable pattern.

Why

GitHub Actions templates substitutions before the shell parses, so quoting in the script does not protect against values containing `"`, `$`, backticks, or newlines. Per GitHub's hardening guide, the recommended pattern is to pass via `env:` and reference `"$VAR"` in the script.

Files touched

  • `_ci.yml` — package-manager case (×3 jobs), test-verbosity, coverage-exclude-paths.
  • `_upgrade-safety.yml` — package-manager case.
  • `_deploy-testnet.yml` — package-manager, network-index/path, deploy-script, indexing-wait.
  • `_foundry-cicd.yml` — package-manager (×6 jobs), contract-paths, skip-if-no-changes/contracts-changed step output, test-verbosity, coverage-exclude-paths, deploy-script, indexing-wait.

`${{ steps.X.outputs.Y }}` references inside `run:` blocks (e.g. `mkdir -p deployments/${{ steps.network.outputs.network_name }}` in `_deploy-testnet.yml`) are kept as-is — they're driven by our own scripts, not consumer-controlled inputs. Lower priority and out of scope here.

Test plan

  • All 25 unit tests pass.
  • ShellCheck clean.
  • YAML validates.
  • CI green.

🤖 Generated with Claude Code

GitHub Actions templates ${{ inputs.X }} substitutions before the shell
parses, so quoting in the script does not protect against values
containing ", $, backticks, or newlines. Convert every input
substitution inside run: blocks to the env: + quoted-shell-variable
pattern across all four workflows.

Behavior is unchanged for well-formed inputs; misbehaved inputs now
fail closed in the shell rather than escaping out of templating.

Closes #42
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.

Standardize env: pattern for inputs interpolated into run blocks

1 participant