Skip to content

Commit 1027bbe

Browse files
authored
Merge pull request #207 from aclerici38/fix-cosign
fix(chart): properly extract digest for cosign
2 parents aacd9b5 + 312285a commit 1027bbe

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

.github/workflows/cd-helm-release.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,16 +50,17 @@ jobs:
5050
password: ${{ secrets.GITHUB_TOKEN }}
5151

5252
- name: Push chart to OCI registry
53+
id: push
5354
if: steps.cr.outputs.changed_charts != ''
54-
run: helm push .cr-release-packages/*.tgz oci://ghcr.io/${{ github.repository_owner }}/charts
55+
run: |
56+
out=$(helm push .cr-release-packages/*.tgz oci://ghcr.io/${{ github.repository_owner }}/charts)
57+
echo "$out"
58+
echo "digest=$(awk '/^Digest:/ {print $2}' <<<"$out")" >> "$GITHUB_OUTPUT"
5559
5660
- name: Install Cosign
5761
if: steps.cr.outputs.changed_charts != ''
5862
uses: sigstore/cosign-installer@v4.1.2
5963

6064
- name: Sign chart
6165
if: steps.cr.outputs.changed_charts != ''
62-
run: |
63-
ref=ghcr.io/${{ github.repository_owner }}/charts/generic-device-plugin
64-
digest=$(docker buildx imagetools inspect "${ref}:${{ steps.cr.outputs.chart_version }}" --format '{{.Manifest.Digest}}')
65-
cosign sign --yes "${ref}@${digest}"
66+
run: cosign sign --yes "ghcr.io/${{ github.repository_owner }}/charts/generic-device-plugin@${{ steps.push.outputs.digest }}"

0 commit comments

Comments
 (0)