Skip to content

Commit 7863c26

Browse files
mikolalysenkoclaude
andcommitted
ci(release-ecosystems): fix zizmor template-injection findings
The "Audit GitHub Actions" check (zizmor) flagged two HIGH template-injection findings in the new workflow: `github.event.release.tag_name` and `inputs.version` interpolated directly into the resolve-version `run` block. Pass event/input data through `env:` and reference `$RELEASE_TAG`/ `$INPUT_VERSION`/`$EXPECTED_VERSION` instead (also covers the `needs.*.outputs` informational findings). The remaining `use-trusted-publishing` info on `gem push` is suppressed with a justified `# zizmor: ignore` (OIDC trusted publishing is the documented future hardening). `zizmor` now reports no findings. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 1068be3 commit 7863c26

2 files changed

Lines changed: 28 additions & 5 deletions

File tree

.github/workflows/release-ecosystems.yml

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,17 @@ jobs:
3535
steps:
3636
- name: Resolve version + tag
3737
id: v
38+
# Pass event/input data through env (never interpolate `${{ ... }}`
39+
# directly into the shell) to avoid template-injection (zizmor).
40+
env:
41+
EVENT_NAME: ${{ github.event_name }}
42+
RELEASE_TAG: ${{ github.event.release.tag_name }}
43+
INPUT_VERSION: ${{ inputs.version }}
3844
run: |
39-
if [ "${{ github.event_name }}" = "release" ]; then
40-
TAG="${{ github.event.release.tag_name }}"
45+
if [ "$EVENT_NAME" = "release" ]; then
46+
TAG="$RELEASE_TAG"
4147
else
42-
TAG="v${{ inputs.version }}"
48+
TAG="v${INPUT_VERSION}"
4349
fi
4450
VERSION="${TAG#v}"
4551
echo "TAG=$TAG" >> "$GITHUB_OUTPUT"
@@ -61,19 +67,25 @@ jobs:
6167
# Ruby is pre-installed on ubuntu-latest; no setup action needed.
6268
- name: Lint + build the launcher gem
6369
working-directory: gem/socket-patch
70+
env:
71+
EXPECTED_VERSION: ${{ needs.resolve-version.outputs.version }}
6472
run: |
6573
ruby -c lib/socket_patch/launcher.rb
6674
ruby -c exe/socket-patch
6775
# The gemspec version is baked at the tag by scripts/version-sync.sh.
6876
gemver="$(ruby -e 'print Gem::Specification.load("socket-patch.gemspec").version')"
69-
if [ "$gemver" != "${{ needs.resolve-version.outputs.version }}" ]; then
70-
echo "::error::gemspec version $gemver != release ${{ needs.resolve-version.outputs.version }} (run scripts/version-sync.sh before tagging)"
77+
if [ "$gemver" != "$EXPECTED_VERSION" ]; then
78+
echo "::error::gemspec version $gemver != release $EXPECTED_VERSION (run scripts/version-sync.sh before tagging)"
7179
exit 1
7280
fi
7381
gem build socket-patch.gemspec
7482
7583
- name: Publish socket-patch to RubyGems
7684
working-directory: gem/socket-patch
85+
# zizmor: ignore[use-trusted-publishing]
86+
# Uses an API key for now; RubyGems trusted publishing (OIDC) is the
87+
# documented future hardening (see the header), mirroring the crates.io
88+
# / PyPI jobs. Suppressed until that publisher is registered.
7789
env:
7890
GEM_HOST_API_KEY: ${{ secrets.RUBYGEMS_API_KEY }}
7991
VERSION: ${{ needs.resolve-version.outputs.version }}

Cargo.lock

Lines changed: 11 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)