mirror of
https://github.com/apple/swift-nio
synced 2026-11-24 04:37:54 +00:00
Pass workflow inputs through environment variables instead of inline
template expansion
### Motivation
* `${{ inputs.* }}` expressions used directly in `run:` blocks are
expanded by GitHub Actions before the shell runs, which can allow code
injection via template expansion (see
https://docs.zizmor.sh/audits/#template-injection).
### Modifications
* Move `${{ inputs.* }}` and `${{ matrix.config.* }}` references out of
`run:` blocks and into step-level `env:` blocks across 13 workflow
files.
### Result
* All high-confidence `template-injection` findings from `zizmor` are
resolved.
* No changes should be required in downstream caller workflows
This can be seen successfully in use via test commits here:
- https://github.com/apple/swift-nio/actions/runs/23000641572?pr=3549
- https://github.com/apple/swift-log/actions/runs/23001027416?pr=427
- https://github.com/grpc/grpc-swift-2/actions/runs/23001010064?pr=43