Skip to content

Commit a62a3a2

Browse files
committed
key based cosign
1 parent d71a297 commit a62a3a2

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

.github/workflows/ssh-key-signer-server-docker.yml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,10 +79,15 @@ jobs:
7979
APP_NAME=${{ steps.extract_version.outputs.MAVEN_NAME }}
8080
APP_VERSION=${{ steps.extract_version.outputs.MAVEN_VERSION }}
8181
82-
- name: Install Cosign
82+
- name: install Cosign
8383
if: startsWith(github.ref, 'refs/tags/v')
8484
uses: sigstore/cosign-installer@v3.8.1
8585

86+
- name: write cosign key to file
87+
if: startsWith(github.ref, 'refs/tags/v')
88+
run: |
89+
echo "${{ secrets.COSIGN_PRIVARY_KEY }}" >> cosign.key
90+
8691
- name: sign the published docker image
8792
if: startsWith(github.ref, 'refs/tags/v')
8893
env:
@@ -91,4 +96,7 @@ jobs:
9196
DIGEST: ${{ steps.build-and-push.outputs.digest }}
9297
# This step uses the identity token to provision an ephemeral certificate
9398
# against the sigstore community Fulcio instance.
94-
run: cosign sign --yes ghcr.io/your-org/your-image@${DIGEST}
99+
run: |
100+
echo "${TAGS}" | while read tag; do
101+
cosign sign --key cosign.key $tag
102+
done

0 commit comments

Comments
 (0)