Skip to content

Commit

Permalink
chore: Adicionar verificação de TAGS e DIGEST antes de assinar a imagem
Browse files Browse the repository at this point in the history
  • Loading branch information
nataliagranato committed Aug 26, 2024
1 parent eed6f31 commit 1a61795
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions .github/workflows/chainguard.yml
Original file line number Diff line number Diff line change
Expand Up @@ -120,10 +120,21 @@ jobs:
# Assinar imagem com o Cosign
- name: Assinar imagem com uma chave
run: |
if [ -z "${TAGS}" ] || [ -z "${DIGEST}" ]; then
echo "Erro: TAGS ou DIGEST não estão definidos."
exit 1
fi
images=""
for tag in ${TAGS}; do
images+="${tag}@${DIGEST} "
done
if [ -z "$images" ]; then
echo "Erro: Nenhuma imagem para assinar."
exit 1
fi
cosign sign --yes --key env://COSIGN_PRIVATE_KEY $images
env:
TAGS: ${{ steps.meta.outputs.tags }}
Expand Down

0 comments on commit 1a61795

Please sign in to comment.