Skip to content

Commit

Permalink
feat: allow signing the image with cosign CLI
Browse files Browse the repository at this point in the history
  • Loading branch information
meysam81 committed Nov 13, 2024
1 parent c372cef commit 36922ca
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ inputs:
default: .
description: Context of the Dockerfile
required: false
cosign:
default: "false"
description: Whether or not to sign the image with Cosign
required: false
dockerhub-password:
default: ""
description: Docker Hub password
Expand Down Expand Up @@ -104,6 +108,10 @@ runs:
with:
ref: ${{ inputs.ref }}

- if: inputs.cosign == 'true'
name: Setup Cosign CLI
uses: sigstore/cosign-installer@v3

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

Expand Down Expand Up @@ -208,3 +216,9 @@ runs:
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: results.sarif

- if: inputs.cosign == 'true'
name: Sign image with cosign
run: |
cosign sign --yes ${{ steps.build-push.outputs.digest }}
shell: bash

0 comments on commit 36922ca

Please sign in to comment.