Skip to content

Commit

Permalink
try to fix the devcontainer cosign
Browse files Browse the repository at this point in the history
Signed-off-by: Justin Pflueger <[email protected]>
  • Loading branch information
jpflueger committed Mar 7, 2024
1 parent 98e44c9 commit 1eddd0d
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions .github/workflows/docker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,11 @@ jobs:
id-token: write
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

# Install the cosign tool except on PR
# https://github.com/sigstore/cosign-installer
- name: Install cosign
if: github.event_name != 'pull_request'
uses: sigstore/[email protected]

- name: Set up QEMU
Expand Down Expand Up @@ -66,11 +65,16 @@ jobs:
skipContainerUserIdUpdate: true
platform: linux/amd64,linux/arm64
runCmd: spin --version
push: always

# Sign the resulting Docker image digest except on PRs.
- name: Sign the published Docker image
if: ${{ github.event_name != 'pull_request' }}
env:
IMAGE: ghcr.io/${{ github.repository }}
TAGS: ${{ steps.meta.outputs.tags }}
DIGEST: ${{ steps.build-and-push.outputs.digest }}
run: echo "${TAGS}" | xargs -I {} cosign sign --yes {}@${DIGEST}
run: |
for tag in "${TAGS[@]}"; do
IMAGE_TAG="ghcr.io/${IMAGE}:${tag}"
DIGEST=$(docker image ls "$IMAGE_TAG" --digests --format='{{.Digest}}')
cosign sign --yes "${IMAGE_TAG}@${DIGEST}"
done

0 comments on commit 1eddd0d

Please sign in to comment.