From 2a0b26d600aadceb7395506df5292cf1e4966b81 Mon Sep 17 00:00:00 2001 From: Nnamdi Michael Okpala Date: Fri, 2 Oct 2026 16:09:10 +0100 Subject: [PATCH] Fix the Release workflow failing on its source-archive check The v0.1.2 tag's Release run failed before building anything: in `gzip -dc archive | git get-tar-commit-id`, get-tar-commit-id reads only the tar header and exits, gzip then hits a broken pipe, and the step's `bash -e -o pipefail` turns that into a failure (exit 141). Decompress to a file first. Reproduced and verified against the real v0.1.2 archive under the runner's exact shell options: the archive is commit 3bc3879 and both recipes pin to 0.1.2-1. Same latent pattern in verify-pacman-client.sh (`pacman -Qi | grep -q`): capture the output first. No tag is moved: the existing v0.1.2 is rebuilt by dispatching this workflow from main with tag=v0.1.2. Co-Authored-By: Claude Opus 5.5 --- .github/workflows/release.yml | 5 ++++- packaging/repo/verify-pacman-client.sh | 5 +++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 7b35f22..8688501 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -71,7 +71,10 @@ jobs: archive="source/obicall-$VERSION.tar.gz" curl -fsSL -o "$archive" "https://github.com/$GITHUB_REPOSITORY/archive/refs/tags/$TAG.tar.gz" # The archive GitHub serves must be exactly the tagged commit. - archived=$(gzip -dc "$archive" | git get-tar-commit-id) + # (Decompressed to a file first: get-tar-commit-id reads only the + # header, and under pipefail gzip's broken pipe would fail the step.) + gzip -dc "$archive" > "$RUNNER_TEMP/source.tar" + archived=$(git get-tar-commit-id < "$RUNNER_TEMP/source.tar") [ "$archived" = "$(git rev-parse HEAD)" ] || { echo "::error::archive is commit $archived, tag is $(git rev-parse HEAD)"; exit 1; } cp packaging/archlinux/PKGBUILD source/PKGBUILD.archlinux cp packaging/msys2/mingw-w64-obicall/PKGBUILD source/PKGBUILD.msys2 diff --git a/packaging/repo/verify-pacman-client.sh b/packaging/repo/verify-pacman-client.sh index 98cb4a8..9168b5e 100755 --- a/packaging/repo/verify-pacman-client.sh +++ b/packaging/repo/verify-pacman-client.sh @@ -61,8 +61,9 @@ else fi # ------------------------------------------------------------------------- -pacman -Qi "$package" | grep -E '^(Name|Version|Validated By)' -pacman -Qi "$package" | grep -q '^Validated By.*Signature' \ +info=$(pacman -Qi "$package") +grep -E '^(Name|Version|Validated By)' <<< "$info" +grep -q '^Validated By.*Signature' <<< "$info" \ || { echo "FAIL: pacman did not validate $package by signature" >&2; exit 1; } installed=$(pacman -Q "$package" | cut -d' ' -f2) if [ -n "$version" ] && [ "$installed" != "$version" ]; then