Skip to content

Commit 8022547

Browse files
Merge pull request #9 from jasperboerhof/feat/npm-ci-offline-flags
feat: pass --prefer-offline --no-audit --no-fund to npm ci
2 parents f5c6b70 + e9ade95 commit 8022547

2 files changed

Lines changed: 7 additions & 2 deletions

File tree

README.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,12 @@ Installs Node.js, runs `npm ci` against the host-mounted `~/.npm` download cache
3737
| `node-version` | `22` | Node.js version |
3838
| `working-directory` | `.` | Directory with `package-lock.json` |
3939

40-
`npm ci` runs every invocation. Fast on warm `~/.npm`.
40+
`npm ci` runs every invocation with `--prefer-offline --no-audit --no-fund`:
41+
- `--prefer-offline` skips registry metadata lookups when the warm `~/.npm` cache satisfies the lockfile.
42+
- `--no-audit` skips the audit POST to the registry (audit belongs in a dedicated job, not every install).
43+
- `--no-fund` skips funding output.
44+
45+
Postinstall scripts still run every invocation — the flags only affect network round-trips, not script execution.
4146

4247
### setup-php
4348

setup-node/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,4 @@ runs:
2626
- name: npm ci
2727
shell: bash
2828
working-directory: ${{ inputs.working-directory }}
29-
run: npm ci
29+
run: npm ci --prefer-offline --no-audit --no-fund

0 commit comments

Comments
 (0)