Skip to content

Commit

Permalink
Use examples that work with multiple tags (#155)
Browse files Browse the repository at this point in the history
Signed-off-by: Jürgen Kreileder <jk@blackdown.de>
  • Loading branch information
jkreileder committed Dec 18, 2023
1 parent 9614fae commit b18d21a
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions README.md
Expand Up @@ -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 }}
Expand All @@ -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
Expand Down

0 comments on commit b18d21a

Please sign in to comment.