feat(preview-release): fix latest pollution on first publish + stream pnpm output#20
Merged
Merged
Conversation
… pnpm output Port the improvements from monorepo-preview-release (#18) to the standalone preview-release action. npm force-assigns the `latest` dist-tag to a package's first-ever publish even when `--tag pr-<n>` is used, so a brand-new library's preview build silently became the default that `pnpm add <pkg>` (no tag) resolves to. Capture the first-time publish (checked before publishing) and remove the auto-assigned `latest` afterwards (best-effort, never fatal): only `pr-<n>` remains, so `pnpm add <pkg>` fails loudly until a real release re-points `latest`, while `<pkg>@pr-<n>` and exact-version installs keep working. Also: - Stream mutating commands (pnpm version/publish/dist-tag) to the Actions log via a `runLogged` helper using tinyexec's async iterator, while keeping the JSON query command (view) silent so its parsed output isn't corrupted. tinyexec consumes the child streams once, so we capture during iteration and read `proc.exitCode` after the loop. - Report `firstTime` in the vland-bot payload so the PR comment can flag a preview whose `latest` was just removed. - core.setSecret(npm_token) to mask any accidental echo in streamed output. dist/ rebuilt via ncc. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
Ports the improvements landed in
monorepo-preview-release(#18) to the standalonepreview-releaseaction, which was merged in #19 without them.First-time
latestpollutionnpm force-assigns the
latestdist-tag to a package's first-ever publish even when--tag pr-<n>is used, so a brand-new library's preview build silently became the default thatpnpm add <pkg>(no tag) resolves to.The action now captures the first-time publish (checked before publishing) and removes the auto-assigned
latestafterwards (pnpm dist-tag rm <pkg> latest), best-effort and never fatal:pr-<n>remains, sopnpm add <pkg>fails loudly until a real release re-pointslatest.<pkg>@pr-<n>and exact-version installs keep working.Also
pnpm version/publish/dist-tag) stream their combined output to the Actions log via arunLoggedhelper (tinyexec async iterator) inside collapsible groups. The JSON query command (pnpm view) stays silent so its parsed output isn't corrupted.firstTimein payload — reported per package tovland-botso the PR comment can flag previews whoselatestwas just removed.core.setSecret(npm_token)— masks any accidental echo in the now-streamed output (this also makes the code match the existing claim in the action's README security notes).dist/rebuilt via ncc.tscandbiome checkpass.🤖 Generated with Claude Code