Skip to content

Commit

Permalink
Add digest when retagging image
Browse files Browse the repository at this point in the history
  • Loading branch information
timdittler committed Oct 18, 2024
1 parent b0cb186 commit f59c6e4
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit f59c6e4

Please sign in to comment.