ci: use npm ci for website checks - #19788
Open
FrankChen021 wants to merge 1 commit into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the website dependency installation step used by CI web checks to be reproducible and to validate that the committed package-lock.json matches package.json.
Changes:
- Switch website dependency installation from
npm installtonpm ciin the web checks script.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
What changed
Use
npm ciinstead ofnpm installwhen installing website dependencies in the web checks workflow.Why
The repository commits
website/package-lock.json, and Dependabot security updates can intentionally modify only that lockfile when updating a transitive dependency.npm installmay reconcile or rewrite dependency resolution during CI, which means a passing build does not prove that the committed manifest and lockfile are consistent or that the exact locked dependency graph was tested.npm cifails whenpackage.jsonandpackage-lock.jsondisagree, installs the exact committed dependency graph, and does not rewrite the lockfile. This makes website dependency checks reproducible while leaving the local development workflow unchanged; developers can continue to usenpm installwhen adding or updating dependencies.Validation
bash -n .github/scripts/web-checks.shcd website && npm cinpm run buildnpm run link-lintnpm run spellcheck