Skip to content

Commit

Permalink
feat(verify): Support verification against certificates
Browse files Browse the repository at this point in the history
  • Loading branch information
EyeCantCU committed Dec 19, 2023
1 parent 83a345d commit 07602f6
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions verify/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,18 @@ name: 'Cosign Action - Verify'
author: 'EyeCantCU'
description: 'Verifies target container'
inputs:
cert-identity:
description: 'The identity certificate'
required: false
container:
description: 'Path to target container to verify'
required: true
pubkey:
description: 'Public key used by target container'
required: true
required: false
oidc-issuer:
description: 'The certificate OIDC issuer'
required: false
runs:
using: "composite"
steps:
Expand All @@ -23,6 +29,13 @@ runs:

- name: Verify container
shell: bash
run: cosign verify --key ${{ inputs.pubkey }} ${{ steps.container_case.outputs.lowercase }}
run: |
if [[ -n "${{ inputs.pubkey }}" ]]; then
cosign verify --key ${{ inputs.pubkey }} ${{ steps.container_case.outputs.lowercase }}
elif [[ -n "${{ inputs.cert-identity }}" && -n "${{ inputs.oidc-issuer }}" ]]; then
cosign verify ${{ steps.container_case.outputs.lowercase }} --certificate-identity=${{ inputs.cert-identity }} --certificate-oidc-issuer=${{ inputs.oidc-issuer }}
else
exit 1
fi
env:
COSIGN_EXPERIMENTAL: false

0 comments on commit 07602f6

Please sign in to comment.