Skip to content

Commit

Permalink
Merge pull request #14 from github/fetch-digest-with-crane
Browse files Browse the repository at this point in the history
Use crane to fetch OCI image digest
  • Loading branch information
malancas authored Jun 5, 2024
2 parents ffaf187 + c326740 commit a7fc8cf
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,11 @@ jobs:
password: ${{ secrets.GITHUB_TOKEN }}
- name: Push packaged chart to GHCR
run: helm push ${{ github.ref_name }}.tgz oci://${{ env.REGISTRY }}/${{ github.repository }}
- uses: imjasonh/setup-crane@00c9e93efa4e1138c9a7a5c594acd6c75a2fbf0c # v0.3
- name: Get pushed chart digest
id: get-digest
run: |
# helm show chart prints the digest to stderr, so redirect stderr and
# extract the digest from the output
digest=$(helm show chart oci://${{ env.REGISTRY }}/${{ github.repository }}/${{ steps.release-details.outputs.chart_name }} --version ${{ steps.release-details.outputs.chart_version }} 2>&1 | grep "^Digest" | sed 's/^Digest: //')
digest=$(crane digest ${{ env.REGISTRY }}/${{ env.repository }}/${{ steps.release-details.outputs.chart_name }}:${{ steps.release-details.outputs.chart_version }})
echo digest=$digest >> $GITHUB_OUTPUT
- name: Attest
uses: actions/attest-build-provenance@173725a1209d09b31f9d30a3890cf2757ebbff0d # v1.1.2
Expand Down

0 comments on commit a7fc8cf

Please sign in to comment.