Skip to content

Commit 30bf9cf

Browse files
wthrbtnclaude
andcommitted
ci: fix helm chart signing to use digest instead of tag
Cosign requires a digest reference for OCI artifacts. Capture the digest from helm push output and sign with @sha256:... instead of :tag. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 174f56c commit 30bf9cf

1 file changed

Lines changed: 9 additions & 4 deletions

File tree

.github/workflows/release.yml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -167,18 +167,23 @@ jobs:
167167
run: echo "${{ secrets.GITHUB_TOKEN }}" | helm registry login ghcr.io -u ${{ github.actor }} --password-stdin
168168

169169
- name: Package and push
170+
id: push-chart
171+
env:
172+
OWNER: ${{ github.repository_owner }}
170173
run: |
171174
helm package charts/cooked/
172175
PACKAGE=$(ls cooked-*.tgz)
173-
helm push "$PACKAGE" oci://ghcr.io/${{ github.repository_owner }}/charts
176+
OUTPUT=$(helm push "$PACKAGE" oci://ghcr.io/${OWNER}/charts 2>&1)
177+
echo "$OUTPUT"
178+
DIGEST=$(echo "$OUTPUT" | grep -oP 'sha256:[a-f0-9]+')
179+
echo "digest=${DIGEST}" >> "$GITHUB_OUTPUT"
174180
175181
- name: Sign chart
176182
env:
177-
TAG: ${{ needs.release-please.outputs.tag_name }}
178183
OWNER: ${{ github.repository_owner }}
184+
DIGEST: ${{ steps.push-chart.outputs.digest }}
179185
run: |
180-
VERSION="${TAG#v}"
181-
cosign sign --yes "ghcr.io/${OWNER}/charts/cooked:${VERSION}"
186+
cosign sign --yes "ghcr.io/${OWNER}/charts/cooked@${DIGEST}"
182187
183188
upload-assets:
184189
needs: [release-please, build-binaries]

0 commit comments

Comments
 (0)