fix: get publising working#4
Open
DNR500 wants to merge 1 commit into
Open
Conversation
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
Fix CI publish of
@RaspberryPiFoundation/scratch-guito GitHub Packages by skipping npm lifecycle scripts duringnpm publish. The existingprepublishOnlyhook blocks all publishes (including CI).Problem
CI on
code-classroomrunsnpm publishfor@RaspberryPiFoundation/scratch-guiafter a successful build. Publish fails becausepackages/scratch-guidefines aprepublishOnlyscript that always exits with code 1 to discourage manual publishes. npm runs that hook on every publish, including CI, so the job never uploads to GitHub Packages.npm versionin the same step succeeds; the failure happens whennpm publishtriggersprepublishOnly.CI error
https://github.com/RaspberryPiFoundation/scratch-editor/actions/runs/26237618439/job/77215053999
Solution
Add
--ignore-scriptsto the publish step in.github/workflows/ci.yml:Why this should work
npm run build, sodist/is present before publish. Skipping lifecycle scripts at publish time does not skip the build.prepublishOnlyis intended to block localnpm publish; npm does not distinguish CI from a developer machine.--ignore-scriptsskips that hook so GPR publish can complete.prepublishOnlyinpackage.jsonstill discourages manual publishes from a laptop.Test plan
code-classroom(or push this branch and merge via PR).13.7.3-code-classroom.<timestamp>.