Skip to content

Commit

Permalink
feat(verify): Support verification of multiple containers at once
Browse files Browse the repository at this point in the history
Requires they share the same public key/certificate
  • Loading branch information
EyeCantCU committed Dec 19, 2023
1 parent 8bffcc8 commit ab80317
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test-actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ jobs:
- name: Verify image
uses: ./verify
with:
container: ghcr.io/${{ github.repository_owner }}/${{ matrix.image_name }}
containers: ghcr.io/${{ github.repository_owner }}/${{ matrix.image_name }}
pubkey: ./cosign.pub

- name: Echo outputs
Expand Down
9 changes: 5 additions & 4 deletions verify/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ inputs:
cert-identity:
description: 'The identity certificate'
required: false
container:
description: 'Path to target container to verify'
containers:
description: 'Paths to target containers'
required: true
pubkey:
description: 'Public key used by target container'
Expand All @@ -31,11 +31,12 @@ runs:
shell: bash
run: |
if [[ -n "${{ inputs.pubkey }}" ]]; then
cosign verify --key ${{ inputs.pubkey }} ${{ steps.container_case.outputs.lowercase }}
cosign verify --key ${{ inputs.pubkey }} ${CONTAINERS[@]}
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 }}
cosign verify --certificate-identity=${{ inputs.cert-identity }} --certificate-oidc-issuer=${{ inputs.oidc-issuer }} ${CONTAINERS[@]}
else
exit 1
fi
env:
CONTAINERS: ${{ steps.container_case.outputs.lowercase }}
COSIGN_EXPERIMENTAL: false

0 comments on commit ab80317

Please sign in to comment.