ci: fix release Pack step writing multi-line output to GITHUB_OUTPUT - #26
Merged
Conversation
The v0.1.1 tag was pushed and the release workflow ran, but failed at the Pack step before npm publish, so nothing was published and 0.1.1 is not burned. `npm pack --silent` still prints the prepack lifecycle banner to stdout on the runner, so `tarball="$(npm pack --silent)"` captured a multi-line string. Writing that to $GITHUB_OUTPUT failed with "Unable to process file command 'output'", failing the job before publish. Fix: - Build explicitly instead of relying on npm's prepack lifecycle hook. - Pack with --ignore-scripts so no lifecycle output is produced. - Derive the tarball filename from package.json instead of parsing pack's stdout, and assert the file exists so a future npm naming change fails loudly instead of silently. Refs #7
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
npm publish— nothing was published, so 0.1.1 is not burned.npm pack --silentstill prints the prepack lifecycle banner to stdout on the runner, sotarball="$(npm pack --silent)"captured a multi-line string, and writing that to$GITHUB_OUTPUTfailed with "Unable to process file command 'output'".--ignore-scriptsso no lifecycle output is produced, and derives the tarball filename from the manifest instead of parsing stdout — plus asserts the file exists so a future npm naming change fails loudly rather than silently.Changes
CI
pnpm buildexplicitly, packs withnpm pack --ignore-scripts --silent, derives the tarball filename frompackage.jsonvianode -p, and asserts the file exists before writing it to$GITHUB_OUTPUT.Test plan
actionlintcleanattwandpublintboth pass against that exact tarball withsrc/presentRefs #7