From 1ea1712d3db8f0c40189819910ace3dc98e070a7 Mon Sep 17 00:00:00 2001 From: Tomas Rutkauskas Date: Mon, 9 Nov 2026 17:37:20 +0200 Subject: [PATCH] ci: write the wheel's METADATA to a file before grep -q checks it `unzip -p ... METADATA | grep -qx "Version: $VERSION"` under pipefail has the shape of the tar | grep -q check that failed at random in convertapi-library-js's build on 2026-11-09. Here it cannot fail on GitHub's runners today: unzip writes the 6 KB METADATA in one write(), and with SIGPIPE ignored, as on the runner, unzip -p ignores EPIPE and exits 0. With a METADATA over 64 KB and the default SIGPIPE disposition it could, so the check now reads a file and depends on neither. Co-Authored-By: Claude Opus 5.5 --- .github/workflows/publish.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index af0ef0f..6695f4b 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -158,7 +158,10 @@ jobs: test -f "dist/$PACKAGE-$VERSION.tar.gz" test -f "dist/$PACKAGE-$VERSION-py3-none-any.whl" test "$(ls dist | wc -l)" -eq 2 - unzip -p "dist/$PACKAGE-$VERSION-py3-none-any.whl" "$PACKAGE-$VERSION.dist-info/METADATA" | grep -qx "Version: $VERSION" + # METADATA goes to a file first. grep -q exits at the Version line, so unzip piped into it could + # still be writing (it writes 64 KB at a time), get SIGPIPE and fail the step under pipefail. + unzip -p "dist/$PACKAGE-$VERSION-py3-none-any.whl" "$PACKAGE-$VERSION.dist-info/METADATA" > "$RUNNER_TEMP/METADATA" + grep -qx "Version: $VERSION" "$RUNNER_TEMP/METADATA" # The tests run against the built wheel, installed outside the checkout, so they see what users get. # The `live` tests run too when the CONVERTAPI_SECRET secret exists.