Skip to content

ci: install netlify-cli via npx, pinned to a major#22460

Open
GirlBossRush wants to merge 1 commit into
mainfrom
ci/netlify-cli-npx
Open

ci: install netlify-cli via npx, pinned to a major#22460
GirlBossRush wants to merge 1 commit into
mainfrom
ci/netlify-cli-npx

Conversation

@GirlBossRush
Copy link
Copy Markdown
Contributor

Summary

Replaces npm install -g netlify-cli with npx --yes --package=netlify-cli@26 in .github/workflows/ci-docs-source.yml.

Two reasons:

  1. -g installs bypass the project .npmrc. npm walks up from the install cwd, not from the global prefix, so ignore-scripts=true and save-exact=true (root .npmrc:1) don't apply to a -g install — lifecycle scripts run and the version is unpinned. npx invoked inside the repo honors the project .npmrc.
  2. No version pin → resolves latest every run. That's exactly the resolution behavior the recent npm "Mini Shai-Hulud" incident weaponized. Pinning @26 bounds the major; Dependabot can manage upgrades through the same cooldown window as the rest of the npm deps.

Test plan

  • The CI - Source code docs workflow runs successfully on main after merge and publishes to Netlify as before.
  • npx --yes --package=netlify-cli@26 -- netlify deploy --dir=source_docs --prod produces 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.)

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>
@GirlBossRush GirlBossRush requested a review from a team as a code owner May 19, 2026 11:31
run: |
npm install -g netlify-cli
netlify deploy --dir=source_docs --prod
npx --yes --package=netlify-cli@26 -- netlify deploy --dir=source_docs --prod
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we could just add it as a dep or dev dep to the root package.json

@netlify
Copy link
Copy Markdown

netlify Bot commented May 19, 2026

Deploy Preview for authentik-docs ready!

Name Link
🔨 Latest commit 72eb609
🔍 Latest deploy log https://app.netlify.com/projects/authentik-docs/deploys/6a0c49fc4a1e7c0008cb219e
😎 Deploy Preview https://deploy-preview-22460--authentik-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@codecov
Copy link
Copy Markdown

codecov Bot commented May 19, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.22%. Comparing base (bc3c12a) to head (72eb609).
⚠️ Report is 1 commits behind head on main.
✅ All tests successful. No failed tests found.

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     
Flag Coverage Δ
conformance 36.57% <ø> (ø)
e2e 41.85% <ø> (+<0.01%) ⬆️
integration 32.55% <ø> (-0.50%) ⬇️
rust 0.00% <ø> (ø)
unit 88.34% <ø> (-3.87%) ⬇️
unit-migrate 92.25% <ø> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants