Bind the GHCR credentials and chart version in helm-publish - #6270
Merged
Conversation
The two registry logins piped secrets.GITHUB_TOKEN and passed github.actor into a run block by interpolation, so both landed in the script text rather than arriving as arguments. They are bound through env: instead. The packaging step passed the chart version unquoted. That value derives from GITHUB_REF_NAME, and git ref names may contain ';', '$', backticks and '|', so it is the one value in this file that could plausibly carry a metacharacter. It is now bound and quoted. The remaining expressions here are github.repository and matrix values, which cannot hold a shell metacharacter. They are left alone: this workflow runs only during a release and cannot be exercised by a pull request, so changes to it need to earn their risk. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #6270 +/- ##
==========================================
+ Coverage 72.70% 72.72% +0.01%
==========================================
Files 742 742
Lines 77299 77299
==========================================
+ Hits 56201 56216 +15
+ Misses 17136 17122 -14
+ Partials 3962 3961 -1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
10 tasks
jhrozek
approved these changes
Aug 10, 2026
This was referenced Aug 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fourth of the release-workflow changes tracked in #6253, after #6263 and #6266. Deliberately narrow — see the scope note.
Summary
github.actorinto the script text.${{ }}is substituted before the shell parses the block, sosecrets.GITHUB_TOKENwas written into the run script on disk rather than arriving through the environment. Both are now bound viaenv:. These are the two High findings.GITHUB_REF_NAME, and git ref names may contain;,$, backticks and|— unlike a repository name. It is the one value in this file that could plausibly carry a metacharacter, so it is now bound and quoted.helm-publish.ymlgoes from 14template-injectionfindings to 9, clearing both High ones. Repo-wide High goes 4 → 2; the two left are the app tokens increate-release-tag.ymlandreleaser.yml.Scope — why only three steps
The other nine findings in this file are
github.repositoryandmatrix.chart.*, neither of which can hold a shell metacharacter. Converting them would touch the push, sign, verify and summary steps for no security benefit.This workflow runs only during a release, cannot be exercised by any pull request, and runs after
image-build-and-push— so a failure leaves images in GHCR, charts not, with the tag already cut. Changes here have to earn their risk, and a stylistic sweep does not. That is also why the twoartipackedfindings are untouched.An earlier draft of this work converted the whole file, including moving the version from a step output to
$GITHUB_ENV. That was correctly pushed back on as a refactor of value plumbing in an untestable path, and it is not repeated here.Part of #6253
Type of change
Test plan
Unit tests (
task test)E2E tests (
task test-e2e)Linting (
task lint-fix)Manual testing (describe below)
Confirmed
REGISTRYis a workflow-levelenv:and so is already present in every step's shell environment — the logins now reference"$REGISTRY"directly rather than re-interpolating${{ env.REGISTRY }}.Confirmed the three touched steps are self-contained: no step output, artifact or later step depends on anything the change alters.
steps.version.outputs.versionis still produced and still consumed by the untouched steps exactly as before.Workflow parses as YAML;
actionlintclean.zizmoron this file:template-injectionHigh 2 → 0, total 14 → 9.This cannot be verified before merge —
helm-publish.ymlisworkflow_callonly, invoked fromreleaser.ymlonrelease: published. The first real exercise is the next release.Does this introduce a user-facing change?
No.
Special notes for reviewers
CHART_VERSION.helm package --version "$CHART_VERSION"must produce the same.tgzname the later push and sign steps expect — those steps still build that name from${{ steps.version.outputs.version }}, and both now resolve from the same step output. Worth reading the packaging, push and sign steps together to confirm the names still line up.template-injectionfindings and twoartipackedfindings in this file are intentional and recorded in zizmor findings backlog: pins, expressions and checkout credentials #6253, not oversights.Generated with Claude Code