Directly reference private key in signing step (#19)
This commit is contained in:
16
.github/workflows/build.yml
vendored
16
.github/workflows/build.yml
vendored
@@ -94,21 +94,33 @@ jobs:
|
|||||||
password: ${{ env.REGISTRY_PASSWORD }}
|
password: ${{ env.REGISTRY_PASSWORD }}
|
||||||
extra-args: |
|
extra-args: |
|
||||||
--disable-content-trust
|
--disable-content-trust
|
||||||
|
|
||||||
# Sign container
|
# Sign container
|
||||||
- uses: sigstore/cosign-installer@main
|
- uses: sigstore/cosign-installer@main
|
||||||
|
|
||||||
|
# Only needed when running `cosign sign` using a key
|
||||||
|
- name: Write signing key to disk
|
||||||
|
run: |
|
||||||
|
echo "${{ env.COSIGN_PRIVATE_KEY }}" > cosign.key
|
||||||
|
# DEBUG: get character count of key
|
||||||
|
wc -c cosign.key
|
||||||
|
env:
|
||||||
|
COSIGN_PRIVATE_KEY: ${{ secrets.SIGNING_SECRET }}
|
||||||
|
|
||||||
- name: Login to GitHub Container Registry
|
- name: Login to GitHub Container Registry
|
||||||
uses: docker/login-action@v2
|
uses: docker/login-action@v2
|
||||||
with:
|
with:
|
||||||
registry: ghcr.io
|
registry: ghcr.io
|
||||||
username: ${{ github.actor }}
|
username: ${{ github.actor }}
|
||||||
password: ${{ secrets.GITHUB_TOKEN }}
|
password: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
- name: Sign container image
|
- name: Sign container image
|
||||||
run: |
|
run: |
|
||||||
cosign sign ${{ steps.registry_case.outputs.lowercase }}/${{ env.IMAGE_NAME }}@${TAGS}
|
cosign sign --key cosign.key ${{ steps.registry_case.outputs.lowercase }}/${{ env.IMAGE_NAME }}@${TAGS}
|
||||||
env:
|
env:
|
||||||
TAGS: ${{ steps.push.outputs.digest }}
|
TAGS: ${{ steps.push.outputs.digest }}
|
||||||
COSIGN_PRIVATE_KEY: ${{secrets.SIGNING_SECRET}}
|
|
||||||
COSIGN_EXPERIMENTAL: false
|
COSIGN_EXPERIMENTAL: false
|
||||||
|
|
||||||
- name: Echo outputs
|
- name: Echo outputs
|
||||||
run: |
|
run: |
|
||||||
echo "${{ toJSON(steps.push.outputs) }}"
|
echo "${{ toJSON(steps.push.outputs) }}"
|
||||||
|
|||||||
Reference in New Issue
Block a user