From 4dc6f2ba70a966b44d7e8067591a8e68c7e49222 Mon Sep 17 00:00:00 2001 From: Alem Tuzlak Date: Tue, 5 May 2026 15:06:48 +0200 Subject: [PATCH] fix(publish): make retry_publish surface failure output under bash -e MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Both retry_publish functions captured command output via: output=$("$@" 2>&1) rc=$? echo "$output" GitHub Actions launches bash with -e (errexit). Under set -e, a failing command substitution can terminate the script before the next line runs. That meant when vsce or ovsx returned non-zero, the script died at the `output=$(...)` line — neither the captured output nor the retry/ classification logic ever executed. The job just exited with code 1 showing only the '##[group]vsce publish attempt 1/5' header. The previous single-target version of this workflow had the same bug latent; it never triggered because vsce always succeeded for that flow. The new multi-target run hit a real vsce failure and the bug ate the diagnostic. Replace the bare assignment with an explicit if/else, which set -e is documented to handle correctly: if output=$("$@" 2>&1); then rc=0; else rc=$?; fi echo "$output" No version bump — 0.2.2 was never on the Marketplace (vsce publish silently failed for all 4 targets), so the prepare gate will let a re-run through. ovsx already has 0.2.2 for all targets and will return 'already exists' which retry_publish treats as idempotent success. --- .github/workflows/publish.yml | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 5a9672b8d..51ec00056 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -239,8 +239,12 @@ jobs: local i output rc wait for (( i=1; i<=attempts; i++ )); do echo "::group::vsce publish attempt $i/$attempts (${{ matrix.target }})" - output=$("$@" 2>&1) - rc=$? + # The if/else is load-bearing: GitHub runs `bash -e`, and a + # failed command substitution `output=$(cmd)` under set -e + # terminates the script *before* the echo below can run, so + # vsce/ovsx errors get swallowed silently. The if-form is + # explicitly handled by set -e and lets both branches set rc. + if output=$("$@" 2>&1); then rc=0; else rc=$?; fi echo "$output" echo "::endgroup::" @@ -302,8 +306,12 @@ jobs: local i output rc wait for (( i=1; i<=attempts; i++ )); do echo "::group::ovsx publish attempt $i/$attempts (${{ matrix.target }})" - output=$("$@" 2>&1) - rc=$? + # The if/else is load-bearing: GitHub runs `bash -e`, and a + # failed command substitution `output=$(cmd)` under set -e + # terminates the script *before* the echo below can run, so + # vsce/ovsx errors get swallowed silently. The if-form is + # explicitly handled by set -e and lets both branches set rc. + if output=$("$@" 2>&1); then rc=0; else rc=$?; fi echo "$output" echo "::endgroup::"