From e59bf92b134f45bf190d723c604845da25194c2e Mon Sep 17 00:00:00 2001 From: Carlgo11 Date: Wed, 17 Jul 2024 03:41:47 +0200 Subject: [PATCH] Fix publish action --- .github/workflows/publish.yml | 3 +++ scripts/Sign.sh | 16 ++++++++++------ 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index ab9ab5a3446..b3ecea10dff 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -6,6 +6,7 @@ on: paths: - 'entries/**' - 'img/**' + - 'scripts/*' concurrency: group: 'publish' @@ -22,6 +23,8 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 + with: + fetch-depth: '2' - name: Set up Node.js uses: actions/setup-node@v4 diff --git a/scripts/Sign.sh b/scripts/Sign.sh index 5170febe43c..72c0b41d5a5 100644 --- a/scripts/Sign.sh +++ b/scripts/Sign.sh @@ -1,16 +1,16 @@ #!/bin/bash -# Load environment variables -source .env +# Create a temporary file to track the status +STATUS_FILE=$(mktemp) +echo 0 > "$STATUS_FILE" sign_and_verify() { local f="$1" echo "$f.sig" echo "$PGP_PASSWORD" | gpg --yes --passphrase --local-user "$PGP_KEY_ID" --output "$f.sig" --sign "$f" 2>/dev/null - gpg --verify "$f.sig" 2>/dev/null - if [ $? -ne 0 ]; then - echo "::error f=$f:: File signing failed" - exit 1 + if ! gpg --verify "$f.sig" 2>/dev/null; then + echo "::error f=$f:: File signing failed for $f" + echo 1 > "$STATUS_FILE" fi } @@ -21,3 +21,7 @@ done # Wait for all background processes to complete wait + +STATUS=$(cat "$STATUS_FILE") +rm "$STATUS_FILE" +exit "$STATUS"