Skip to content

Commit

Permalink
fix(ci): fix cosign image signing
Browse files Browse the repository at this point in the history
  • Loading branch information
chgl authored Sep 7, 2023
1 parent ab8f3be commit 151b295
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -136,16 +136,14 @@ jobs:
- name: Install Cosign
uses: sigstore/cosign-installer@11086d25041f77fe8fe7b9ea4e48e3b9192b8f19 # v3.1.2

# via <https://github.com/actions/starter-workflows/blob/main/ci/docker-publish.yml>
- name: Sign image
env:
IMAGES: ${{ needs.build.outputs.image-tags }}
# <https://docs.github.com/en/actions/security-guides/security-hardening-for-github-actions#using-an-intermediate-environment-variable>
TAGS: ${{ needs.build.outputs.image-tags }}
DIGEST: ${{ needs.build.outputs.image-digest }}
COSIGN_EXPERIMENTAL: "true"
run: |
while read -r image; do
echo "Signing '$image' using keyless approach"
cosign sign "$image@$DIGEST"
done <<< "$IMAGES"
echo "${TAGS}" | xargs -I {} cosign sign --yes {}@"${DIGEST}"
container-provenance:
if: ${{ startsWith(github.ref, 'refs/tags/') }}
Expand Down

0 comments on commit 151b295

Please sign in to comment.