Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -110,10 +110,13 @@ jobs:
- name: Pack release tarball
id: pack
run: |
# npm pack writes the tarball to CWD and prints its filename to stdout.
# --silent suppresses the progress banner that would otherwise pollute
# the step output value.
TARBALL=$(npm pack --silent)
# npm pack writes the tarball name to stdout as its final line, but
# the prepack hook (`bun run build`) ALSO writes to stdout (build
# banner + bundled-assets table). `--silent` only suppresses npm's
# own progress banner, not the prepack hook's output. Capturing
# the full stdout therefore yields a multi-line blob ending with
# the tarball name; `tail -n1` extracts the filename reliably.
TARBALL=$(npm pack --silent | tail -n1)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Preserve npm pack exit status in tarball capture

TARBALL=$(npm pack --silent | tail -n1) masks failures from npm pack because this workflow step does not set shell: bash, so the default non-Windows shell runs without pipefail and the pipeline status is taken from tail. That means an npm pack error can be treated as success if tail exits 0 and ${TARBALL} still points to an existing file, allowing the release job to continue from a failed pack operation. Capture npm pack output without a pipeline (or enable pipefail) so pack failures still stop the workflow.

Useful? React with 👍 / 👎.

if [ -z "${TARBALL}" ] || [ ! -f "${TARBALL}" ]; then
echo "npm pack produced no tarball" >&2
exit 1
Expand Down
Loading