Skip to content

Commit 9a27f93

Browse files
unhappychoiceclaude
andcommitted
fix(ci): fail Homebrew SHA step on HTTP errors
curl -sL exits 0 on a 404, so sha256sum digested the error body and the formula was updated with a bogus SHA while the job stayed green. Use curl -f with set -o pipefail so a missing asset aborts the step. Closes #236 Co-Authored-By: Claude Opus 5 <[email protected]>
1 parent d588987 commit 9a27f93

1 file changed

Lines changed: 10 additions & 4 deletions

File tree

‎.github/workflows/release.yml‎

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -255,19 +255,25 @@ jobs:
255255

256256
- name: Update Homebrew formula
257257
run: |
258+
set -euo pipefail
259+
260+
fetch_sha() {
261+
curl -fsSL --retry 3 --retry-delay 5 "$1" | sha256sum | cut -d' ' -f1
262+
}
263+
258264
VERSION=${{ needs.release.outputs.new_version }}
259265
260266
MACOS_INTEL_URL="https://github.com/unhappychoice/gitlogue/releases/download/$VERSION/gitlogue-$VERSION-x86_64-apple-darwin.tar.gz"
261-
MACOS_INTEL_SHA=$(curl -sL "$MACOS_INTEL_URL" | sha256sum | cut -d' ' -f1)
267+
MACOS_INTEL_SHA=$(fetch_sha "$MACOS_INTEL_URL")
262268
263269
MACOS_ARM_URL="https://github.com/unhappychoice/gitlogue/releases/download/$VERSION/gitlogue-$VERSION-aarch64-apple-darwin.tar.gz"
264-
MACOS_ARM_SHA=$(curl -sL "$MACOS_ARM_URL" | sha256sum | cut -d' ' -f1)
270+
MACOS_ARM_SHA=$(fetch_sha "$MACOS_ARM_URL")
265271
266272
LINUX_INTEL_URL="https://github.com/unhappychoice/gitlogue/releases/download/$VERSION/gitlogue-$VERSION-x86_64-unknown-linux-gnu.tar.gz"
267-
LINUX_INTEL_SHA=$(curl -sL "$LINUX_INTEL_URL" | sha256sum | cut -d' ' -f1)
273+
LINUX_INTEL_SHA=$(fetch_sha "$LINUX_INTEL_URL")
268274
269275
LINUX_ARM_URL="https://github.com/unhappychoice/gitlogue/releases/download/$VERSION/gitlogue-$VERSION-aarch64-unknown-linux-gnu.tar.gz"
270-
LINUX_ARM_SHA=$(curl -sL "$LINUX_ARM_URL" | sha256sum | cut -d' ' -f1)
276+
LINUX_ARM_SHA=$(fetch_sha "$LINUX_ARM_URL")
271277
272278
echo "Calculated SHAs:"
273279
echo "macOS Intel: $MACOS_INTEL_SHA"

0 commit comments

Comments
 (0)