Skip to content

Commit 57fdecd

Browse files
feat: enable npm cache by default to reduce 403 errors (#1092)
* feat: enable npm cache by default to reduce 403 errors Add npm_cache input (default: "true") and actions/cache step for ~/.npm to avoid downloading renovate from npm registry on every run, reducing 403 Forbidden errors and speeding up installation. Close #1091 * test
1 parent 950d04f commit 57fdecd

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

.github/workflows/test.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,3 +39,7 @@ jobs:
3939
uses: ./
4040
with:
4141
config_file_path: ${{ steps.files.outputs.files }}
42+
- name: Test with npm_cache disabled
43+
uses: ./
44+
with:
45+
npm_cache: "false"

action.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,24 @@ inputs:
3737
3838
You can specify multiple files by multiple lines.
3939
required: false
40+
npm_cache:
41+
description: |
42+
Enable npm cache to speed up the installation of renovate.
43+
If it's "true", the npm cache is enabled.
44+
default: "true"
45+
required: false
4046
runs:
4147
using: composite
4248
steps:
4349
- uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0
4450
if: inputs.node-version != 'none'
4551
with:
4652
node-version: ${{inputs.node-version}}
53+
- uses: actions/cache@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5.0.3
54+
if: inputs.npm_cache == 'true'
55+
with:
56+
path: ~/.npm
57+
key: renovate-npm-${{ runner.os }}
4758
- name: Validate Renovate Configuration with renovate-config-validator
4859
run: |
4960
set -eu

0 commit comments

Comments
 (0)