Skip to content

Commit

Permalink
chore(action): Use awk to ensure container path is lowercase
Browse files Browse the repository at this point in the history
  • Loading branch information
EyeCantCU committed Dec 24, 2023
1 parent 8bffcc8 commit 4a404a3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
8 changes: 4 additions & 4 deletions sign/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,14 @@ runs:
# https://github.com/macbre/push-to-ghcr/issues/12
- name: Lowercase container path
id: container_case
uses: ASzc/change-string-case-action@v5
with:
string: ${{ inputs.container }}
shell: bash
run: |
echo ${{ inputs.container }} | awk '{print tolower($0)}'
- name: Sign container image
shell: bash
run: |
cosign sign -y --key env://COSIGN_PRIVATE_KEY ${{ steps.container_case.outputs.lowercase }}@${TAGS}
cosign sign -y --key env://COSIGN_PRIVATE_KEY ${{ steps.container_case.outputs }}@${TAGS}
env:
COSIGN_EXPERIMENTAL: false
COSIGN_PRIVATE_KEY: ${{ inputs.signing-secret }}
Expand Down
10 changes: 5 additions & 5 deletions verify/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,17 @@ runs:
# https://github.com/macbre/push-to-ghcr/issues/12
- name: Lowercase container path
id: container_case
uses: ASzc/change-string-case-action@v5
with:
string: ${{ inputs.container }}
shell: bash
run: |
echo ${{ inputs.container }} | awk '{print tolower($0)}'
- name: Verify container
shell: bash
run: |
if [[ -n "${{ inputs.pubkey }}" ]]; then
cosign verify --key ${{ inputs.pubkey }} ${{ steps.container_case.outputs.lowercase }}
cosign verify --key ${{ inputs.pubkey }} ${{ steps.container_case.outputs }}
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 ${{ steps.container_case.outputs }} --certificate-identity=${{ inputs.cert-identity }} --certificate-oidc-issuer=${{ inputs.oidc-issuer }}
else
exit 1
fi
Expand Down

0 comments on commit 4a404a3

Please sign in to comment.