ci: install netlify-cli via npx, pinned to a major#22460
Open
GirlBossRush wants to merge 1 commit into
Open
Conversation
Replace `npm install -g netlify-cli` with `npx --yes --package=netlify-cli@26` in the source-docs publish workflow. Two reasons: 1. A `-g` install bypasses the repo `.npmrc` (npm only walks up from the cwd of the install, not from the global prefix), so `ignore-scripts=true` and `save-exact=true` do not apply — install scripts run and a fresh `latest` is resolved on every CI run. `npx` invoked inside the repo honors the project `.npmrc`. 2. Without a version pin, every run pulls whatever `latest` happens to be at that moment, which is exactly the resolution behavior that the recent npm "Mini Shai-Hulud" incident weaponized. Pinning to `@26` bounds the major and lets Dependabot manage upgrades through the same cooldown window as everything else. Co-authored-by: Agent <279763771+playpen-agent@users.noreply.github.com>
BeryJu
reviewed
May 19, 2026
| run: | | ||
| npm install -g netlify-cli | ||
| netlify deploy --dir=source_docs --prod | ||
| npx --yes --package=netlify-cli@26 -- netlify deploy --dir=source_docs --prod |
Member
There was a problem hiding this comment.
we could just add it as a dep or dev dep to the root package.json
✅ Deploy Preview for authentik-docs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #22460 +/- ##
==========================================
- Coverage 93.27% 93.22% -0.05%
==========================================
Files 1032 1032
Lines 60059 60059
Branches 400 400
==========================================
- Hits 56018 55992 -26
- Misses 4041 4067 +26
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
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
Replaces
npm install -g netlify-cliwithnpx --yes --package=netlify-cli@26in.github/workflows/ci-docs-source.yml.Two reasons:
-ginstalls bypass the project.npmrc. npm walks up from the install cwd, not from the global prefix, soignore-scripts=trueandsave-exact=true(root.npmrc:1) don't apply to a-ginstall — lifecycle scripts run and the version is unpinned.npxinvoked inside the repo honors the project.npmrc.latestevery run. That's exactly the resolution behavior the recent npm "Mini Shai-Hulud" incident weaponized. Pinning@26bounds the major; Dependabot can manage upgrades through the same cooldown window as the rest of the npm deps.Test plan
CI - Source code docsworkflow runs successfully onmainafter merge and publishes to Netlify as before.npx --yes --package=netlify-cli@26 -- netlify deploy --dir=source_docs --prodproduces a working deploy.(Workflow triggers only on
push: main, so the smoke test is post-merge — happy to gate on a dry run first if preferred.)