From b18d21aaa20ef40c4e681202a598b7591d5be577 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrgen=20Kreileder?= Date: Mon, 18 Dec 2023 11:53:11 +0100 Subject: [PATCH] Use examples that work with multiple tags (#155) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jürgen Kreileder --- README.md | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 2ba2382..1bf67d9 100644 --- a/README.md +++ b/README.md @@ -137,7 +137,11 @@ jobs: # https://docs.github.com/en/actions/security-guides/security-hardening-for-github-actions#using-an-intermediate-environment-variable - name: Sign image with a key run: | - cosign sign --yes --key env://COSIGN_PRIVATE_KEY "${TAGS}@${DIGEST}" + images="" + for tag in ${TAGS}; do + images+="${tag}@${DIGEST} " + done + cosign sign --yes --key env://COSIGN_PRIVATE_KEY ${images} env: TAGS: ${{ steps.docker_meta.outputs.tags }} COSIGN_PRIVATE_KEY: ${{ secrets.COSIGN_PRIVATE_KEY }} @@ -148,7 +152,12 @@ jobs: env: DIGEST: ${{ steps.build-and-push.outputs.digest }} TAGS: ${{ steps.docker_meta.outputs.tags }} - run: cosign sign --yes "${TAGS}@${DIGEST}" + run: | + images="" + for tag in ${TAGS}; do + images+="${tag}@${DIGEST} " + done + cosign sign --yes ${images} ``` ### Optional Inputs