Use CI-appropriate package manager commands (npm ci, etc.) #396
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.
Warning⚠️ - developed by a GenAI agent
I (Sam) didn't write this code, nor this PR description! But I did get here from experiencing the issue myself, on a datasource I've been working on where Renovate has been making PRs. Each of those PRs was passing CI when I merged them, and yet I found drift on my
package-lock.jsonfile today.What this PR does
This PR updates the frontend action to use CI-appropriate package manager commands that automatically enforce lock file consistency.
Changes
Updates
actions/internal/plugins/frontend/pm.shto use CI-optimized install commands:npm ciinstead ofnpm installpnpm install --frozen-lockfileyarn install --frozen-lockfileWhy this is needed
Currently, CI runs standard install commands (
npm install, etc.) which don't fail if lock files are out of sync withpackage.json. This can allow drift to slip through, causing:Benefits of this approach
package.jsonnpm ciremovesnode_modulesfirst for a fresh installTesting
The CI-appropriate commands are well-established best practices:
npm cihas been the recommended CI command since npm 5.7.0 (2018)--frozen-lockfileis the standard flag for pnpm and yarn in CIThis change should be backward compatible - existing plugins will see faster, stricter installs.
Draft Status
Opening as draft to gather feedback on this approach before merging.