fix(ci): run validate without a package-lock.json#2
Conversation
The repo has no committed package-lock.json. The validate workflow used `actions/setup-node` with `cache: npm` (which requires a lockfile to compute the cache key) and `npm ci` (which requires a lockfile to install). Both fail with: Dependencies lock file is not found ... Supported file patterns: package-lock.json, npm-shrinkwrap.json, yarn.lock Switch the workflow to invoke spectral and redocly directly via `npx --yes`, pinned to the same versions as `package.json`'s devDependencies. No install step or cache needed. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR Code Suggestions ✨No code suggestions found for the PR. |
There was a problem hiding this comment.
Pull request overview
Updates the GitHub Actions validate workflow to run Spectral and Redocly via npx so CI can validate OpenAPI specs without requiring a committed lockfile (and without npm ci).
Changes:
- Remove
actions/setup-nodenpm caching and thenpm ciinstall step (no lockfile required). - Run Spectral linting and Redocly bundling directly via
npx --yeswith explicit package/version selectors.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| - name: Lint OpenAPI specs with Spectral | ||
| run: npx spectral lint specs/v3/*.yaml --fail-severity error | ||
| run: npx --yes @stoplight/spectral-cli@^6.14.0 lint specs/v3/*.yaml --fail-severity error | ||
|
|
||
| - name: Bundle OpenAPI specs | ||
| run: npx redocly bundle specs/v3/*.yaml -o bundled/openapi-v3.yaml | ||
| run: npx --yes @redocly/cli@^1.28.0 bundle specs/v3/*.yaml -o bundled/openapi-v3.yaml | ||
|
|
||
| - name: Verify bundled spec is valid | ||
| run: npx spectral lint bundled/openapi-v3.yaml --fail-severity error | ||
| run: npx --yes @stoplight/spectral-cli@^6.14.0 lint bundled/openapi-v3.yaml --fail-severity error |
| - name: Lint OpenAPI specs with Spectral | ||
| run: npx spectral lint specs/v3/*.yaml --fail-severity error | ||
| run: npx --yes @stoplight/spectral-cli@^6.14.0 lint specs/v3/*.yaml --fail-severity error |
User description
Summary
The
validateworkflow has been failing on every PR (including the first sync PR #1 fromsmileidentity/lambda's automated sync workflow):Two reasons:
actions/setup-nodewithcache: npmrequires a lockfile to compute the cache key.npm cirequires a lockfile to install.The repo doesn't commit one. Switching the workflow to invoke spectral and redocly directly via
npx --yes(pinned to the same versions aspackage.json's devDependencies) drops both requirements.This unblocks sync PR #1 and any future automated sync PRs from
lambda.Test plan
🤖 Generated with Claude Code
PR Type
Bug fix
Description
Fix CI workflow failing due to missing package-lock.json
Remove
cache: npmandnpm cisteps from validate workflowUse
npx --yeswith pinned package versions directlyUnblocks automated sync PRs from lambda repo
Diagram Walkthrough
File Walkthrough
validate.yml
Remove lockfile dependency from CI validate workflow.github/workflows/validate.yml
cache: npmoption fromactions/setup-nodestepnpm ciinstall step entirelynpx spectraltonpx --yes @stoplight/spectral-cli@^6.14.0npx redoclytonpx --yes @redocly/cli@^1.28.0