From 323b27074b57d558d39c604b47fd2d8c543c731f Mon Sep 17 00:00:00 2001 From: Marvin Winkler Date: Fri, 5 Jul 2024 19:19:24 +0200 Subject: [PATCH] github fixes --- .github/workflows/docker-publish.yml | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index 8f6df6f..8dc5000 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -79,6 +79,19 @@ jobs: cache-from: type=gha cache-to: type=gha,mode=max + # Sign the resulting Docker image digest except on PRs. + # This will only write to the public Rekor transparency log when the Docker + # repository is public to avoid leaking data. If you would like to publish + # transparency data even for private images, pass --force to cosign below. + # https://github.com/sigstore/cosign + - name: Sign the published tagged Docker image + if: ${{ github.event_name != 'pull_request' && !endsWith(steps.docker_version_tag.outputs.tag, 'latest') }} + env: + COSIGN_EXPERIMENTAL: "true" + # This step uses the identity token to provision an ephemeral certificate + # against the sigstore community Fulcio instance. + run: echo "${{ steps.meta.outputs.tags }}" | xargs -I {} cosign sign {}@${{ steps.build-and-push-tagged.outputs.digest }} + # Build and push Docker image with Buildx (don't push on PR) # https://github.com/docker/build-push-action - name: Build and push Docker image as latest @@ -99,10 +112,10 @@ jobs: # repository is public to avoid leaking data. If you would like to publish # transparency data even for private images, pass --force to cosign below. # https://github.com/sigstore/cosign - - name: Sign the published Docker image + - name: Sign the published latest Docker image if: ${{ github.event_name != 'pull_request' && !endsWith(steps.docker_version_tag.outputs.tag, 'latest') }} env: COSIGN_EXPERIMENTAL: "true" # This step uses the identity token to provision an ephemeral certificate # against the sigstore community Fulcio instance. - run: echo "${{ steps.meta.outputs.tags }}" | xargs -I {} cosign sign {}@${{ steps.build-and-push.outputs.digest }} \ No newline at end of file + run: echo "${{ steps.meta.outputs.tags }}" | xargs -I {} cosign sign {}@${{ steps.build-and-push-latest.outputs.digest }} \ No newline at end of file