Skip to content

fix(ci): [OPS-723] prevent script injection in workflow run: blocks#17

Merged
yotamleo merged 2 commits intomainfrom
fix/ops-723-prevent-ci-script-injection
Apr 7, 2026
Merged

fix(ci): [OPS-723] prevent script injection in workflow run: blocks#17
yotamleo merged 2 commits intomainfrom
fix/ops-723-prevent-ci-script-injection

Conversation

@yotamleo
Copy link
Copy Markdown
Contributor

@yotamleo yotamleo commented Apr 1, 2026

Summary

  • Move all ${{ }} expressions from run: blocks to env: blocks across 4 workflow files to prevent potential shell injection in this public repo
  • Replace fragile ${{ matrix.install }} pattern in ci.yml with conditional if: runner.os steps (matching existing pattern in release workflows)
  • Medium risk fixed: ${{ needs.release-please.outputs.tag_name }} was interpolated directly into shell commands in release-please.yml

Files Changed

  • .github/workflows/release-please.ymltag_name, goos, goarchenv: block
  • .github/workflows/release.ymlgoos, goarch → use existing $GOOS/$GOARCH env vars
  • .github/workflows/ci.yml — replace matrix.install with conditional steps
  • .github/workflows/gitleaks.yamlevent_name, SHAs, forcedenv: block

Test plan

  • Verify YAML is valid (checked locally with yaml.safe_load)
  • Verify zero ${{ }} remain in any run: block (checked locally)
  • CI passes on this PR
  • Release workflow still builds correctly on next release

Jira: https://knostic.atlassian.net/browse/OPS-723

🤖 Generated with Claude Code

Move all ${{ }} expressions from run: blocks to env: blocks to prevent
potential shell injection in public repo CI. Replace fragile matrix.install
pattern with conditional steps.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Branch protection requires check names that include the install command
(e.g. "build (ubuntu-latest, sudo apt-get update ...)"). Keep the
include matrix for naming but use conditional steps instead of
${{ matrix.install }} for execution.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@yotamleo yotamleo merged commit 2ad30ce into main Apr 7, 2026
4 checks passed
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.

2 participants