Skip to content

fix(ci): extract npm pack tarball name from final stdout line - #1690

Merged
namastex888 merged 1 commit into
mainfrom
fix/post-1689-build-regression
May 7, 2026
Merged

namastex888 merged 1 commit into
mainfrom
fix/post-1689-build-regression

Conversation

@namastex888

Copy link
Copy Markdown
Contributor

Summary

Fixes the Pack release tarball step in .github/workflows/release.yml, which has been failing on every push to main since 2026-04-23 when cosign keyless signing landed (a9ae5649). Latest casualty: the merge commit for #1689 (668e9a8b).

Root cause

TARBALL=\$(npm pack --silent) captures all stdout, not just the tarball name. The prepack hook (bun run build) writes its own output to stdout — banner + bundled-assets table — and that output is not silenced by npm --silent (which only suppresses npm's own progress banner, not script-hook stdout).

So \$TARBALL ends up being a multi-line blob:

$ bun build src/genie.ts ...
Bundled 544 modules in 183ms

  genie.js                                    5.15 MB  (entry point)
  ...
automagik-genie-4.260428.3.tgz   <-- the actual filename

[ ! -f "\${TARBALL}" ] then fails because \$TARBALL is a multi-line string, exiting 1 with npm pack produced no tarball.

Fix

Pipe through tail -n1 to extract only the final stdout line. npm pack always emits the tarball filename as its last line of stdout, so this is robust regardless of what the prepack hook writes.

Why the workflow has been silently failing

Release runs on push-to-main only. Every Release run on main since 2026-04-28 has failed at the Pack step with this exact symptom — the merge commit and the workflow author both saw --silent and assumed it covered prepack output too. The signing infrastructure downstream is fine; nothing ever got far enough to exercise it.

Test plan

  • Reproduce locally: npm pack --silent returns 17 lines, original [ -f \$TARBALL ] check fails
  • Apply fix: TARBALL=\$(npm pack --silent | tail -n1) returns automagik-genie-4.260428.3.tgz, file check passes
  • Verify Release workflow succeeds end-to-end after merge (cosign sign + verify + SLSA provenance + tamper-detection self-test)

Notes

🤖 Generated with Claude Code

The Release workflow's "Pack release tarball" step has been failing on
every push to main since the cosign keyless signing landed (a9ae564,
2026-04-23). Latest casualty: the merge commit for #1689 (668e9a8).

Root cause: `TARBALL=$(npm pack --silent)` captures ALL stdout, not just
the tarball name. The `prepack` hook (`bun run build`) writes its own
output to stdout — banner + bundled-assets table — and that output is
NOT silenced by `npm --silent` (which only suppresses npm's own
progress banner, not script-hook stdout). So `$TARBALL` ends up being a
multi-line blob:

    $ bun build src/genie.ts ...
    Bundled 544 modules in 183ms

      genie.js                                    5.15 MB  (entry point)
      ...
    automagik-genie-4.260428.3.tgz   <-- the actual filename

`[ ! -f "${TARBALL}" ]` then fails on the multi-line value, exiting 1
with "npm pack produced no tarball".

Fix: pipe through `tail -n1` to extract only the final stdout line,
which npm pack guarantees is the tarball filename.

Verified locally:
- Without fix: TARBALL is 17-line blob, `[ -f $TARBALL ]` fails.
- With fix: TARBALL is `automagik-genie-4.260428.3.tgz`, file check passes.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Note

Gemini is unable to generate a review for this pull request due to the file types involved not being currently supported.

@coderabbitai

coderabbitai Bot commented May 7, 2026

Copy link
Copy Markdown

Warning

Rate limit exceeded

@namastex888 has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 36 minutes and 34 seconds before requesting another review.

To continue reviewing without waiting, purchase usage credits in the billing tab.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: f89a4f51-8590-41f0-8eb4-ace44b0f69e0

📥 Commits

Reviewing files that changed from the base of the PR and between 668e9a8 and d6524e5.

📒 Files selected for processing (1)
  • .github/workflows/release.yml
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/post-1689-build-regression

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@namastex888
namastex888 merged commit 0b24b94 into main May 7, 2026
11 checks passed

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d6524e5647

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

# 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 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant