fix(github): download release helper scripts to $RUNNER_TEMP instead of the checkout - #51
Merged
Merged
Conversation
This was referenced Jul 28, 2026
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.
The problem
The
publishjob fetches its helper scripts into.github/scripts/inside the checkout, then runsnpm publish. That fires the consuming repo'sprepublishOnlyhook, which is usuallynpm run lint && npm run build. So the downloaded scripts get linted as if they were the repo's own source.Two of them (
npm-version-script-auto.cjs,npm-version-script-esm-auto.js) are tab-indented. Any consumer whose lint config disallows tabs fails at exactly this point — after the GitHub release and tag have been created, but beforenpm publishruns.That happened today on
august-yaleandrainbird:august-yale— tag and releasev1.2.8exist, npm is still on1.2.7rainbird— tag and releasev1.2.15exist, npm is still on1.2.14It is an awkward failure to catch, because it is invisible until you release. A local
npm run lintpasses and the CI lint job passes, since both only ever see whatever copy is committed in the repo. The bad copy exists solely inside the release run.Also worth knowing
Because these files land in the working tree before packing, they end up in the published tarball.
august-yale@1.2.7andrainbird@1.2.14both ship a full.github/directory to npm, release scripts included.The change
Fetch into
$RUNNER_TEMP/release-scripts/and run from there, so nothing lands in the checkout.$RUNNER_TEMPis stable for the lifetime of a job, so the download-then-use step pairs still work.This also removes the coupling in the other direction: consumers no longer need to keep their own copies of these scripts lint-clean.
Scope
publish-release.ymlonly.update-version.ymlwrites into the checkout too, but that job never publishes, so nothing lints what it downloads. Itspre-commitinput is also a workspace-relative path handed toTriPSs/conventional-changelog-action, which would need care to move. Left alone deliberately.promote-branch.ymlruns.github/scripts/npm-version-script-*without downloading it, relying on the consuming repo having committed a copy. That is a separate latent issue and is not touched here.Verification
Ran the changed step verbatim against a real
package.json+ lockfile withRUNNER_TEMPset to a non-/tmppath: the script downloads, executes, resolves1.2.7from npm, bumpspackage.jsonto1.2.8, exits 0, and leaves the working tree with onlypackage.jsonandpackage-lock.jsonin it.Reproduced the original failure first, by dropping the current upstream
npm-version-script-esm-auto.jsinto a plugin checkout and running its lint script — 275 errors, allstyle/no-tabsandstyle/indent.Merge order
Independent of #48, #49 and #50 — different lines. #48 also touches this file, but only
uses:lines, so no conflict either way.