From 3fe7d136969b1acc23e0b8bb3ae39b6422533c4d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20M=C3=BCnch?= Date: Fri, 20 Dec 2024 14:31:23 +0100 Subject: [PATCH] build: try to fix transparency log index detection --- .github/workflows/deploy.yml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 517032a2..182f3ee8 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -53,17 +53,21 @@ jobs: - name: Sign PHAR file using Cosign run: | - INDEX=$(cosign sign-blob --yes --output-signature n98-magerun2.phar.sig n98-magerun2.phar | grep "tlog entry created with index:" | awk '{print $NF}') + INDEX=$(cosign sign-blob --yes --output-signature n98-magerun2.phar.sig n98-magerun2.phar | grep "tlog entry created with index:" | awk -F': ' '{print $2}') + if [ -z "$INDEX" ]; then + echo "Error: Transparency Log Entry Index not found!" >&2 + exit 1 + fi echo "Transparency Log Entry Index: $INDEX" echo "REKOR_ENTRY_INDEX=$INDEX" >> $GITHUB_ENV - name: Display Rekor Transparency Log URL run: | - echo "Rekor Transparency Log Entry: https://rekor.sigstore.dev/api/v1/log/entries/${{ env.REKOR_ENTRY_INDEX }}" + echo "Rekor Transparency Log Entry: https://rekor.sigstore.dev/api/v1/log/entries/$REKOR_ENTRY_INDEX" - name: Create Rekor Annotation run: | - echo "::notice file=n98-magerun2.phar::Rekor Transparency Log Entry: https://rekor.sigstore.dev/api/v1/log/entries/${{ env.REKOR_ENTRY_INDEX }}" + echo "::notice file=n98-magerun2.phar::Rekor Transparency Log Entry: https://rekor.sigstore.dev/api/v1/log/entries/$REKOR_ENTRY_INDEX" - name: Import GPG key uses: crazy-max/ghaction-import-gpg@v6