Skip to content

Commit

Permalink
fix: Sign images with all tags in a loop
Browse files Browse the repository at this point in the history
chore: Added cosign.pub
  • Loading branch information
shubms committed Dec 8, 2024
1 parent d0966da commit 1718072
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
9 changes: 8 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,15 @@ jobs:
c86c21ea-98cf-4ca9-b730-b2400146a3a5 > COSIGN_PASSWORD
- name: Sign the container image
env:
TAG: ${{ steps.meta.outputs.tags }}
DIGEST: ${{ steps.build-push.outputs.digest }}
run: |
cosign sign --yes --key env://COSIGN_PRIVATE_KEY ${{ env.REGISTRY }}/${{ github.repository }}/${{ matrix.image }}@${{ steps.build-push.outputs.digest }} ${{ steps.meta.outputs.tags }}
images=""
for tag in ${TAGS}; do
images+="${tag}@${DIGEST} "
done
cosign sign --yes --key env://COSIGN_PRIVATE_KEY ${images}
- name: Cleanup old images
uses: actions/delete-package-versions@v5
Expand Down
4 changes: 4 additions & 0 deletions cosign.pub
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
-----BEGIN PUBLIC KEY-----
MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAELZQY2cPsUJ0+GXC/u9GJfKiZ8sNZ
8idmUGhvnsTm5DjO3HFXueefNZuDZ163kujPfGkFuQ+kR1/KXYVXEhn9kA==
-----END PUBLIC KEY-----

0 comments on commit 1718072

Please sign in to comment.