refactor(publish-helm-chart): convert reusable workflow to composite action#115
Merged
sydorovdmytro merged 1 commit intomainfrom Apr 15, 2026
Merged
Conversation
…action The reusable workflow couldn't resolve its own ref at call time. `github.workflow_ref` and `github.workflow_sha` both leak the caller's context under `workflow_call` — the sparse-checkout of `loft-sh/github-actions` for the scripts used the parsed workflow_ref (`refs/heads/main` for push events, `refs/tags/vX` for releases), which: - On push-to-main: happened to resolve because main/main lined up, but silently pulled scripts from `main` rather than the pinned `@publish-helm-chart/v1` — tag pinning was a lie. - On release events: the caller's `refs/tags/v4.6.0` doesn't exist in `loft-sh/github-actions`, so the first release-triggered caller (pending loft-enterprise release-chart migration) would fail with `fatal: couldn't find remote ref`. Converting to a composite action sidesteps both — `github.action_path` is correct automatically, tag pinning is real, no release-event breakage. Same pattern already used by ci-test-notify, release-notification, linear-release-sync, semver-validation, govulncheck (#109), and go-licenses (#100). Caller contract change (v2, breaking): - `ref` input removed — caller checks out the desired ref themselves - `runs-on` / `timeout-minutes` / `permissions` set by caller - `secrets: chart-museum-*` → regular inputs (actions can't declare secrets; caller interpolates `${{ secrets.* }}`) - Caller supplies `actions/checkout` before the action Only caller today is loft-enterprise push-head-images.yaml (merged via #6673 yesterday) — one migration PR follows. - `.github/scripts/publish-helm-chart/` → `.github/actions/publish-helm-chart/` - Delete `.github/workflows/publish-helm-chart.yaml` - Retarget `test-publish-helm-chart.yaml` path filter + test target - Rewrite README section for the composite-action contract Refs DEVOPS-772
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.
Why
The reusable workflow couldn't resolve its own ref at call time —
github.workflow_refandgithub.workflow_shaboth leak the caller's context underworkflow_call. The sparse-checkout ofloft-sh/github-actionsfor the scripts used the parsed caller ref:refs/heads/main, which happens to exist in this repo too, so checkout "succeeds" — but scripts come fromloft-sh/github-actions@main, not from the pinned@publish-helm-chart/v1tag. Tag pinning was a lie; callers silently drifted whenever main diverged from the tag.refs/tags/v4.6.0, which doesn't exist inloft-sh/github-actions. First release-triggered call would fail withfatal: couldn't find remote ref.Same bug class as #109 (govulncheck) and #100 (go-licenses); same fix: convert to a composite action so
github.action_pathis correct automatically.What
.github/scripts/publish-helm-chart/→.github/actions/publish-helm-chart/(code + 24 bats tests unchanged).github/actions/publish-helm-chart/action.yml— new composite action.github/workflows/publish-helm-chart.yaml— deletedtest-publish-helm-chart.yaml,Makefile,README.md— path updatesCaller contract (breaking, v1 tag force-updated in place)
uses:at job leveluses:at step levelruns-on,timeout-minutes,permissionsbaked inrefinput (caller git ref for checkout)actions/checkout, passes ref theresecrets: chart-museum-user, chart-museum-passwordactions/checkoutfirstTag strategy
Tag stays at
publish-helm-chart/v1and will be force-updated to this merge commit. Rationale: the only existing caller (loft-enterprise push-head-images.yaml, merged yesterday via #6673) was silently drifting anyway — v2 would be churn. Loft-enterprise migration PR follows concurrently.New caller shape
Test plan
make test-publish-helm-chart— 24 tests (skip locally due to mikefarah/yq absence; CI runs full suite)make lint— actionlint + zizmor cleanshellcheck .github/actions/publish-helm-chart/run.sh— cleanmode 100755)Refs DEVOPS-772