|
37 | 37 | # https://github.com/sigstore/cosign-installer
|
38 | 38 | - name: Install cosign
|
39 | 39 |
|
40 |
| - with: |
41 |
| - cosign-release: 'v2.1.1' |
42 | 40 |
|
43 | 41 | - name: Setup Docker buildx
|
44 | 42 |
|
@@ -99,16 +97,23 @@ jobs:
|
99 | 97 | cache-from: type=gha
|
100 | 98 | cache-to: type=gha,mode=max
|
101 | 99 |
|
| 100 | + #TODO: Implement signature using generated key: https://docs.sigstore.dev/signing/quickstart/#signing-with-a-generated-key |
| 101 | + |
102 | 102 | # Sign the resulting Docker image digest except on PRs.
|
103 | 103 | # This will only write to the public Rekor transparency log when the Docker
|
104 | 104 | # repository is public to avoid leaking data. If you would like to publish
|
105 | 105 | # transparency data even for private images, pass --force to cosign below.
|
106 | 106 | # https://github.com/sigstore/cosign
|
107 |
| - - name: Sign the published Docker image |
| 107 | + - name: Sign the published Docker image using GitHub OIDC Token |
108 | 108 | env:
|
109 | 109 | # https://docs.github.com/en/actions/security-guides/security-hardening-for-github-actions#using-an-intermediate-environment-variable
|
110 | 110 | TAGS: ${{ steps.meta.outputs.tags }}
|
111 | 111 | DIGEST: ${{ steps.build-and-push.outputs.digest }}
|
112 | 112 | # This step uses the identity token to provision an ephemeral certificate
|
113 | 113 | # 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