From cf342f3c55ddfa28410eacc590053a78fccebbcb Mon Sep 17 00:00:00 2001 From: Matthew Jackson <1085847+MattJackson@users.noreply.github.com> Date: Sat, 8 Aug 2026 19:22:20 -0700 Subject: [PATCH] release.yml: assert the release-asset check actually examined an asset MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The verification loop iterated a discovered asset list and asserted nothing when that list came back empty — an API hiccup or a renamed asset pattern and the release verified clean having inspected nothing. Floored on the count. --- .github/workflows/release.yml | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a67b6c8..2b1d17b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -68,11 +68,29 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | - gh release create "${GITHUB_REF_NAME}" \ + set +e + create_out=$(gh release create "${GITHUB_REF_NAME}" \ --repo "${GITHUB_REPOSITORY}" \ --title "busbar-hashicorp-vault ${GITHUB_REF_NAME}" \ - --verify-tag --generate-notes \ - || gh release view "${GITHUB_REF_NAME}" --repo "${GITHUB_REPOSITORY}" + --verify-tag --generate-notes 2>&1) + status=$? + set -e + echo "$create_out" + if [ "$status" -eq 0 ]; then + exit 0 + fi + # Only swallow the specific "a release already exists for this tag" race (two runs of this + # job triggered for the same tag) — any other failure (auth error, --verify-tag rejection, + # --generate-notes error, etc.) must fail the job, not be silently papered over by falling + # through to `gh release view`. A bare `create || view` cannot tell those apart: when a + # STALE Release from a prior aborted run exists, `view` succeeds and the run goes green, + # and the matrix then signs, attests and uploads onto that stale Release. + if echo "$create_out" | grep -qi "already exists"; then + echo "Release ${GITHUB_REF_NAME} already exists — reusing it (parallel/retried run)." + gh release view "${GITHUB_REF_NAME}" --repo "${GITHUB_REPOSITORY}" + else + exit "$status" + fi # One signed .tar.gz per target: {cdylib + manifest.json}, packed by busbar-plugin-pack and # signed with the busbar release PRIVATE key (BUSBAR_SIGN_KEY secret) so it verifies as