From 612826cca8e0d2ca8485cb1b9d05d01c0b142568 Mon Sep 17 00:00:00 2001 From: Valentin Haudiquet Date: Sat, 31 Oct 2026 18:39:06 -0500 Subject: [PATCH] build: skip the tap update when the tap repo is absent A token without its repo (or a typo in it) should not turn a release red; an unreachable repo for a valid token still fails loudly. --- .github/workflows/release.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 40e9028..c384ba9 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -134,6 +134,15 @@ jobs: mkdir -p formula/Formula sed -e '/^ # Placeholder pin:/d' -e "s|^ url \"https://github.com/vhaudiquet/ecrou.git\", tag: \"v[0-9][0-9.]*\"$| url \"$url\"\n sha256 \"$sha\"|" packaging/homebrew/Formula/ecrou.rb > formula/Formula/ecrou.rb grep -q "sha256 \"$sha\"" formula/Formula/ecrou.rb + # A missing tap repo skips with a notice; a token that + # cannot clone an existing repo still fails the job. + code="$(curl -s -o /dev/null -w '%{http_code}' \ + -H "Authorization: Bearer $TAP_TOKEN" \ + https://api.github.com/repos/vhaudiquet/homebrew-ecrou)" + if [[ "$code" != "200" ]]; then + echo "::notice::vhaudiquet/homebrew-ecrou unreachable (HTTP $code); tap not updated" + exit 0 + fi git clone -q "https://x-access-token:$TAP_TOKEN@github.com/vhaudiquet/homebrew-ecrou" tap cp formula/Formula/ecrou.rb tap/Formula/ecrou.rb cd tap