Skip to content

Commit

Permalink
fix(actions): Use lowercase workaround in verify, correct its usage
Browse files Browse the repository at this point in the history
  • Loading branch information
EyeCantCU committed Dec 18, 2023
1 parent b852ddf commit 8f5aefc
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 9 deletions.
15 changes: 7 additions & 8 deletions sign/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,21 +27,20 @@ runs:
username: ${{ github.actor }}
password: ${{ inputs.registry-token }}

# Workaround bug where capital letters in your GitHub username make it impossible to push to GHCR.
- name: Install cosign
uses: sigstore/[email protected]

# https://github.com/macbre/push-to-ghcr/issues/12
- name: Lowercase Registry
id: registry_case
uses: ASzc/change-string-case-action@v6
- name: Lowercase container path
id: container_case
uses: ASzc/change-string-case-action@v5
with:
string: ${{ inputs.container }}

- name: Install cosign
uses: sigstore/[email protected]

- name: Sign container image
shell: bash
run: |
cosign sign -y --key env://COSIGN_PRIVATE_KEY ${{ inputs.container }}@${TAGS}
cosign sign -y --key env://COSIGN_PRIVATE_KEY ${{ steps.container_case.outputs.lowercase }}@${TAGS}
env:
COSIGN_EXPERIMENTAL: false
COSIGN_PRIVATE_KEY: ${{ inputs.signing-secret }}
Expand Down
9 changes: 8 additions & 1 deletion verify/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,15 @@ runs:
- name: Install cosign
uses: sigstore/[email protected]

# 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 }}

- name: Verify container
shell: bash
run: cosign verify --key ${{ inputs.pubkey }} ${{ inputs.container }}
run: cosign verify --key ${{ inputs.pubkey }} ${{ steps.container_case.outputs.lowercase }}
env:
COSIGN_EXPERIMENTAL: false

0 comments on commit 8f5aefc

Please sign in to comment.