[core] Fix corepack installation in CircleCI #1405
Merged
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.
npmjs.org rotated the public signing keys but corepack hardcoded the old one, causing all the CI pipelines to fail (example) because it couldn't install pnpm properly: nodejs/corepack#612
This fix fetches the latest keys and storing them in an env variable, taken from this comment: nodejs/corepack#612 (comment)
The alternatives are not as good:
npm install -g corepack@latest
will work but requiressudo
in CircleCI which is annoying to installCOREPACK_INTEGRITY_KEYS=0
disable the signature check, risky!I have followed (at least) the PR section of the contributing guide.