From f59c6e43f5299f29d3807f328118227526b25d4e Mon Sep 17 00:00:00 2001 From: Tim Dittler Date: Fri, 18 Oct 2024 09:12:20 +0200 Subject: [PATCH] Add digest when retagging image --- action.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/action.yml b/action.yml index 626060b..0c983bc 100644 --- a/action.yml +++ b/action.yml @@ -86,7 +86,7 @@ outputs: value: ${{ steps.preparation.outputs.tag }} docker-digest: description: 'Docker digest' - value: ${{ steps.docker_build.outputs.digest }} + value: ${{ steps.docker_build.outputs.digest || steps.docker_retag.outputs.digest }} runs: using: "composite" @@ -213,6 +213,10 @@ runs: curl --fail-with-body -X PUT -H "Content-Type: ${CONTENT_TYPE}" -u '${{ inputs.docker-username }}:${{ inputs.docker-password }}' -d "${MANIFEST}" "${{ inputs.docker-registry-api }}${{ inputs.docker-image}}/manifests/${{ steps.preparation.outputs.tag }}" curl --fail-with-body -X PUT -H "Content-Type: ${CONTENT_TYPE}" -u '${{ inputs.docker-username }}:${{ inputs.docker-password }}' -d "${MANIFEST}" "${{ inputs.docker-registry-api }}${{ inputs.docker-image}}/manifests/${{ steps.preparation.outputs.latest }}" + # Get the digest of the image + DIGEST=$(echo $MANIFEST | jq .config.digest) + echo "digest=$DIGEST" >> $GITHUB_OUTPUT + - name: Checkout GitOps Repository if: inputs.gitops-token != '' uses: actions/checkout@v4