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 9bbbe91 commit d4f66ed
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 4 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/test-actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ jobs:
- name: Sign image
uses: ./sign
with:
container: ${{ steps.registry_case.outputs.lowercase }}/${{ matrix.image_name }}
container: ghcr.io/${{ github.repository_owner }}/${{ matrix.image_name }}
registry: ghcr.io
registry-token: ${{ secrets.GITHUB_TOKEN }}
signing-secret: ${{ secrets.SIGNING_SECRET }}
Expand All @@ -129,7 +129,7 @@ jobs:
- name: Verify image
uses: ./verify
with:
container: ${{ steps.registry_case.outputs.lowercase }}/${{ matrix.image_name }}
container: ghcr.io/${{ github.repository_owner }}/${{ matrix.image_name }}
pubkey: ./cosign.pub

- name: Echo outputs
Expand Down
9 changes: 8 additions & 1 deletion sign/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,17 @@ runs:
- name: Install cosign
uses: sigstore/cosign-installer@v3.3.0

# 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: 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/cosign-installer@v3.3.0

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

Please sign in to comment.