Skip to content

Commit

Permalink
chore(actions): Separate containers by comma
Browse files Browse the repository at this point in the history
  • Loading branch information
EyeCantCU committed Dec 24, 2023
1 parent ec386d9 commit 4583e41
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/test-actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,7 @@ jobs:
- name: Verify Chainguard images
uses: ./verify
with:
containers: |
bash
containers: apko, bash, busybox, caddy, vt
cert-identity: https://github.com/chainguard-images/images/.github/workflows/release.yaml@refs/heads/main
oidc-issuer: https://token.actions.githubusercontent.com
registry: cgr.dev/chainguard
Expand Down
4 changes: 3 additions & 1 deletion sign/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@ runs:
shell: bash
run: |
REGISTRY=$(echo ${{ inputs.registry }} | awk '{print tolower($0)}')
cosign sign -y --key env://COSIGN_PRIVATE_KEY $REGISTRY/${CONTAINERS}@${TAGS}
for CONTAINER in $(echo "${CONTAINERS}" | tr "," "\n"); do
cosign sign -y --key env://COSIGN_PRIVATE_KEY $REGISTRY/${CONTAINER}@${TAGS}
done
env:
CONTAINERS: ${{ inputs.containers }}
COSIGN_EXPERIMENTAL: false
Expand Down
8 changes: 6 additions & 2 deletions verify/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,13 @@ runs:
run: |
REGISTRY=$(echo ${{ inputs.registry }} | awk '{print tolower($0)}')
if [[ -n "${{ inputs.cert-identity }}" && -n "${{ inputs.oidc-issuer }}" ]]; then
cosign verify $REGISTRY/${CONTAINERS} --certificate-identity=${{ inputs.cert-identity }} --certificate-oidc-issuer=${{ inputs.oidc-issuer }}
for CONTAINER in $(echo "${CONTAINERS}" | tr "," "\n"); do
cosign verify $REGISTRY/${CONTAINER} --certificate-identity=${{ inputs.cert-identity }} --certificate-oidc-issuer=${{ inputs.oidc-issuer }}
done
elif [[ -n "${{ inputs.pubkey }}" ]]; then
cosign verify --key ${{ inputs.pubkey }} $REGISTRY/${CONTAINERS}
for CONTAINER in $(echo "${CONTAINERS}" | tr "," "\n"); do
cosign verify --key ${{ inputs.pubkey }} $REGISTRY/${CONTAINER}
done
else
exit 1
fi
Expand Down

0 comments on commit 4583e41

Please sign in to comment.