Skip to content

Commit 02fa057

Browse files
authored
Rewrite cosign step following documentation (#168)
Signed-off-by: Federico Busetti <[email protected]>
1 parent 9405cdb commit 02fa057

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

.github/workflows/ci-pipeline.yml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,6 @@ jobs:
3737
# https://github.com/sigstore/cosign-installer
3838
- name: Install cosign
3939
uses: sigstore/[email protected]
40-
with:
41-
cosign-release: 'v2.1.1'
4240

4341
- name: Setup Docker buildx
4442
uses: docker/[email protected]
@@ -99,16 +97,23 @@ jobs:
9997
cache-from: type=gha
10098
cache-to: type=gha,mode=max
10199

100+
#TODO: Implement signature using generated key: https://docs.sigstore.dev/signing/quickstart/#signing-with-a-generated-key
101+
102102
# Sign the resulting Docker image digest except on PRs.
103103
# This will only write to the public Rekor transparency log when the Docker
104104
# repository is public to avoid leaking data. If you would like to publish
105105
# transparency data even for private images, pass --force to cosign below.
106106
# https://github.com/sigstore/cosign
107-
- name: Sign the published Docker image
107+
- name: Sign the published Docker image using GitHub OIDC Token
108108
env:
109109
# https://docs.github.com/en/actions/security-guides/security-hardening-for-github-actions#using-an-intermediate-environment-variable
110110
TAGS: ${{ steps.meta.outputs.tags }}
111111
DIGEST: ${{ steps.build-and-push.outputs.digest }}
112112
# This step uses the identity token to provision an ephemeral certificate
113113
# against the sigstore community Fulcio instance.
114-
run: echo "${TAGS}" | xargs -I {} cosign sign --yes {}@${DIGEST}
114+
run: |
115+
images=""
116+
for tag in ${TAGS}; do
117+
images+="${tag}@${DIGEST} "
118+
done
119+
cosign sign --yes ${images}

0 commit comments

Comments
 (0)