diff --git a/.github/actions/pr-chart/action.yaml b/.github/actions/pr-chart/action.yaml index 46f589f3..2931dde8 100644 --- a/.github/actions/pr-chart/action.yaml +++ b/.github/actions/pr-chart/action.yaml @@ -103,10 +103,26 @@ runs: helm package ${{ inputs.chart }} --version ${{ env.PR_COMMIT_TAG }} helm push ${{ inputs.registry-repo }}-${{ env.PR_COMMIT_TAG }}.tgz oci://${{ env.CHART_PROJECT }} + - name: get digest + id: digest + if: steps.helm.outcome == 'success' + shell: bash + run: | + helm show chart ${{ inputs.registry-repo }}-${{ env.PR_COMMIT_TAG }} + curl -s -u ${{ inputs.registry-user }}:${{ inputs.registry-token }} "https://${{ inputs.registry }}/service/token?service=service=harbor-registry&scope=repository:${{ inputs.registry-repo }}:pull" + + curl -s -H "Authorization: Bearer $TOKEN" "Accept: application/vnd.oci.image.manifest.v1+json" https://${{ inputs.registry }}/${{ env.CHART_PROJECT }}/manifests/${{ env.PR_TAG }} + digest=$(curl -s -H "Accept: application/vnd.oci.image.manifest.v1+json" https://${{ inputs.registry }}/${{ inputs.registry-repo }}/manifests/${{ env.PR_TAG }} | jq -r '.config.digest') + echo ${digest} + echo "digest=${digest}" >> "$GITHUB_OUTPUT" + + + - name: build success if: steps.helm.outcome == 'success' shell: bash run: | + echo "${{steps.digest.outputs.digest}}" echo "${SUMMARY}" >> "$GITHUB_STEP_SUMMARY" env: SUMMARY: |