Skip to content

Commit

Permalink
Fix Cosign image signing by using digest instead of tag to avoid sign…
Browse files Browse the repository at this point in the history
…ing incorrect image versions

Signed-off-by: Saurabhkr952 <[email protected]>
  • Loading branch information
Saurabhkr952 committed Aug 27, 2024
1 parent 80fdc34 commit 59d2a2b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/multi-stage-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
id: build-and-push
with:
push: true
tags: ${{ steps.docker_meta.outputs.tags }}
tags: saurabhkr952/dev-portfolio:${{ github.sha }}
platforms: linux/amd64,linux/arm64

# https://docs.github.com/en/actions/security-guides/security-hardening-for-github-actions#using-an-intermediate-environment-variable
Expand All @@ -53,7 +53,7 @@ jobs:
done
cosign sign --yes --key env://COSIGN_PRIVATE_KEY ${images}
env:
TAGS: ${{ steps.docker_meta.outputs.tags }}
TAGS: saurabhkr952/dev-portfolio:${{ github.sha }}
COSIGN_PRIVATE_KEY: ${{ secrets.COSIGN_PRIVATE_KEY }}
COSIGN_PASSWORD: ${{ secrets.COSIGN_PASSWORD }}
DIGEST: ${{ steps.build-and-push.outputs.digest }}
Expand Down

0 comments on commit 59d2a2b

Please sign in to comment.