Skip to content

Commit

Permalink
Sign ghcr/prod images using digest and not tag
Browse files Browse the repository at this point in the history
Signed-off-by: Furkat Gofurov <furkat.gofurov@suse.com>
  • Loading branch information
furkatgofurov7 committed Oct 20, 2023
1 parent 702d1b7 commit 7eddb00
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -94,12 +94,18 @@ jobs:
env:
COSIGN_EXPERIMENTAL: 1
run: |
cosign sign --yes ${{ matrix.images.image }}
# Loop through the ghcr images and sign them by digest
for image in "${{ matrix.images.digest }}"; do
cosign sign --yes $image
done
- name: Verify pushed ghcr images
env:
COSIGN_EXPERIMENTAL: 1
run: |
cosign verify ${{ matrix.images.image }} --certificate-identity=https://github.com/rancher-sandbox/rancher-turtles/.github/workflows/release.yaml@refs/tags/${{ env.TAG }} --certificate-oidc-issuer=https://token.actions.githubusercontent.com
# Loop through the ghcr images and verify them by digest
for image in "${{ matrix.images.digest }}"; do
cosign verify $image --certificate-identity=https://github.com/rancher-sandbox/rancher-turtles/.github/workflows/release.yaml@refs/tags/${{ env.TAG }} --certificate-oidc-issuer=https://token.actions.githubusercontent.com
done
ghcr-provenance:
needs: [build-ghcr, ghcr-sign]
Expand Down Expand Up @@ -216,12 +222,18 @@ jobs:
env:
COSIGN_EXPERIMENTAL: 1
run: |
cosign sign --yes ${{ matrix.images.image }}
# Loop through the prod images and sign them by digest
for image in "${{ matrix.images.digest }}"; do
cosign sign --yes $image
done
- name: Verify pushed ghcr images
env:
COSIGN_EXPERIMENTAL: 1
run: |
cosign verify ${{ matrix.images.image }} --certificate-identity=https://github.com/rancher-sandbox/rancher-turtles/.github/workflows/release.yaml@refs/tags/${{ env.TAG }} --certificate-oidc-issuer=https://token.actions.githubusercontent.com
# Loop through the prod images and verify them by digest
for image in "${{ matrix.images.digest }}"; do
cosign verify $image --certificate-identity=https://github.com/rancher-sandbox/rancher-turtles/.github/workflows/release.yaml@refs/tags/${{ env.TAG }} --certificate-oidc-issuer=https://token.actions.githubusercontent.com
done
prod-provenance:
needs: [build-prod, prod-sign]
Expand Down

0 comments on commit 7eddb00

Please sign in to comment.