From 833e0fd9ad14b8454c1f8a313f0359f33321f22f Mon Sep 17 00:00:00 2001 From: AJ Jordan Date: Wed, 9 Mar 2022 17:32:58 -0500 Subject: [PATCH] Support npm-shrinkwrap.json out-of-the-box --- README.md | 2 +- dist/cache-save/index.js | 2 +- dist/setup/index.js | 2 +- src/cache-utils.ts | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 3b9ea0a0c..22598916a 100644 --- a/README.md +++ b/README.md @@ -58,7 +58,7 @@ It's **always** recommended to commit the lockfile of your package manager for s The action has a built-in functionality for caching and restoring dependencies. It uses [actions/cache](https://github.com/actions/cache) under the hood for caching global packages data but requires less configuration settings. Supported package managers are `npm`, `yarn`, `pnpm` (v6.10+). The `cache` input is optional, and caching is turned off by default. -The action defaults to search for the dependency file (`package-lock.json` or `yarn.lock`) in the repository root, and uses its hash as a part of the cache key. Use `cache-dependency-path` for cases when multiple dependency files are used, or they are located in different subdirectories. +The action defaults to search for the dependency file (`package-lock.json`, `npm-shrinkwrap.json` or `yarn.lock`) in the repository root, and uses its hash as a part of the cache key. Use `cache-dependency-path` for cases when multiple dependency files are used, or they are located in different subdirectories. **Note:** The action does not cache `node_modules` diff --git a/dist/cache-save/index.js b/dist/cache-save/index.js index 83c5bcbf9..8c6f476d7 100644 --- a/dist/cache-save/index.js +++ b/dist/cache-save/index.js @@ -59139,7 +59139,7 @@ const exec = __importStar(__nccwpck_require__(1514)); const cache = __importStar(__nccwpck_require__(7799)); exports.supportedPackageManagers = { npm: { - lockFilePatterns: ['package-lock.json', 'yarn.lock'], + lockFilePatterns: ['package-lock.json', 'npm-shrinkwrap.json', 'yarn.lock'], getCacheFolderCommand: 'npm config get cache' }, pnpm: { diff --git a/dist/setup/index.js b/dist/setup/index.js index 7ce48af55..46ba283b9 100644 --- a/dist/setup/index.js +++ b/dist/setup/index.js @@ -70475,7 +70475,7 @@ const exec = __importStar(__nccwpck_require__(1514)); const cache = __importStar(__nccwpck_require__(7799)); exports.supportedPackageManagers = { npm: { - lockFilePatterns: ['package-lock.json', 'yarn.lock'], + lockFilePatterns: ['package-lock.json', 'npm-shrinkwrap.json', 'yarn.lock'], getCacheFolderCommand: 'npm config get cache' }, pnpm: { diff --git a/src/cache-utils.ts b/src/cache-utils.ts index b71bcc8ac..4db730eb1 100644 --- a/src/cache-utils.ts +++ b/src/cache-utils.ts @@ -13,7 +13,7 @@ export interface PackageManagerInfo { export const supportedPackageManagers: SupportedPackageManagers = { npm: { - lockFilePatterns: ['package-lock.json', 'yarn.lock'], + lockFilePatterns: ['package-lock.json', 'npm-shrinkwrap.json', 'yarn.lock'], getCacheFolderCommand: 'npm config get cache' }, pnpm: {