Skip to content

Caching npm deps in lint CI#1304

Merged
jamesbraza merged 2 commits intomainfrom
npm-cache
Feb 25, 2026
Merged

Caching npm deps in lint CI#1304
jamesbraza merged 2 commits intomainfrom
npm-cache

Conversation

@jamesbraza
Copy link
Copy Markdown
Collaborator

lint workflow got killed in this CI run by 403s:

Run suzuki-shunsuke/github-action-renovate-config-validator@v2.0.0
Run actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f
Found in cache @ /opt/hostedtoolcache/node/24.13.0/x64
(node:4098) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
Environment details
Run set -eu
npm error code E403
npm error 403 403 Forbidden - GET https://registry.npmjs.org/to-regex-range
npm error 403 In most cases, you or one of your dependencies are requesting
npm error 403 a package version that is forbidden by your security policy, or
npm error 403 on a server you do not have access to.
npm error A complete log of this run can be found in: /home/runner/.npm/_logs/2026-02-25T18_45_05_471Z-debug-0.log

Let's add npm caching to speed this up and increase reliability

@jamesbraza jamesbraza self-assigned this Feb 25, 2026
Copilot AI review requested due to automatic review settings February 25, 2026 18:49
@jamesbraza jamesbraza added the bug Something isn't working label Feb 25, 2026
@dosubot dosubot bot added the size:XS This PR changes 0-9 lines, ignoring generated files. label Feb 25, 2026
@dosubot
Copy link
Copy Markdown

dosubot bot commented Feb 25, 2026

Related Documentation

Checked 1 published document(s) in 1 knowledge base(s). No updates required.

How did I do? Any feedback?  Join Discord

@dosubot dosubot bot added the enhancement New feature or request label Feb 25, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds npm caching to the lint CI workflow to improve reliability and prevent 403 errors from npm registry rate limiting that were observed during the renovate-config-validator step.

Changes:

  • Added actions/cache@v5 configuration for npm dependencies before the renovate-config-validator action
  • Cache stores ~/.npm directory with a key based on the runner OS

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

uses: actions/cache@v5
with:
path: ~/.npm
key: renovate-npm-${{ runner.os }}
Copy link

Copilot AI Feb 25, 2026

Choose a reason for hiding this comment

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

Consider adding a 'restore-keys' configuration to provide a fallback mechanism. This would allow the cache to be restored from a partial key match if an exact match isn't found, which is particularly useful during dependency updates.

The Docling cache implementation at lines 121-122 demonstrates this pattern:

key: ${{ runner.os }}-docling-${{ hashFiles('uv.lock') }}
restore-keys: ${{ runner.os }}-docling-

For this npm cache, you could add:

restore-keys: |
  renovate-npm-${{ runner.os }}-

This would allow the workflow to reuse a previous cache even if the key has changed, reducing the likelihood of hitting rate limits during cache misses.

Suggested change
key: renovate-npm-${{ runner.os }}
key: renovate-npm-${{ runner.os }}
restore-keys: |
renovate-npm-${{ runner.os }}-

Copilot uses AI. Check for mistakes.
@jamesbraza jamesbraza merged commit 7e3a83a into main Feb 25, 2026
5 of 7 checks passed
@jamesbraza jamesbraza deleted the npm-cache branch February 25, 2026 19:08
jamesbraza added a commit that referenced this pull request Feb 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working enhancement New feature or request size:XS This PR changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants