From e9b2fc071165ac5ba1586f2ab61bd9f02fed6575 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..eac3ba5 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 | tr -d '"') + echo "digest=$DIGEST" >> $GITHUB_OUTPUT + - name: Checkout GitOps Repository if: inputs.gitops-token != '' uses: actions/checkout@v4