diff --git a/README.md b/README.md index 7a36ba38..2603f199 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ This action provides the following functionality for GitHub Actions users: ## Breaking changes in V6 -- Caching is now automatically enabled for npm projects when the `packageManager` field in `package.json` is set to `npm`. For other package managers, such as Yarn and pnpm, caching is disabled by default and must be configured manually using the `cache` input. +- Caching is now automatically enabled for npm projects when either the `devEngines.packageManager` field or the top-level `packageManager` field in `package.json` is set to `npm`. For other package managers, such as Yarn and pnpm, caching is disabled by default and must be configured manually using the `cache` input. ## Breaking changes in V5 @@ -71,7 +71,7 @@ See [action.yml](action.yml) # Default: '' cache: '' - # Controls automatic caching for npm. By default, caching for npm is enabled if the packageManager field in package.json specifies npm and no explicit cache input is provided. + # Controls automatic caching for npm. By default, caching for npm is enabled if either the devEngines.packageManager field or the top-level packageManager field in package.json specifies npm and no explicit cache input is provided. # To disable automatic caching for npm, set package-manager-cache to false. # default: true package-manager-cache: true @@ -189,7 +189,7 @@ steps: - run: npm test ``` -Caching for npm dependencies is automatically enabled when your `package.json` contains a `packageManager` field set to `npm` and no explicit cache input is provided. +Caching for npm dependencies is automatically enabled when your `package.json` contains either `devEngines.packageManager` field or top-level `packageManager` field set to `npm`, and no explicit cache input is provided. This behavior is controlled by the `package-manager-cache` input, which defaults to `true`. To turn off automatic caching, set `package-manager-cache` to `false`. diff --git a/action.yml b/action.yml index 22276180..73c766bc 100644 --- a/action.yml +++ b/action.yml @@ -24,7 +24,7 @@ inputs: cache: description: 'Used to specify a package manager for caching in the default directory. Supported values: npm, yarn, pnpm.' package-manager-cache: - description: 'Set to false to disable automatic caching. By default, caching is enabled when npm is the specified package manager in package.json.' + description: 'Set to false to disable automatic caching. By default, caching is enabled when either devEngines.packageManager or the top-level packageManager field in package.json specifies npm as the package manager.' default: true cache-dependency-path: description: 'Used to specify the path to a dependency file: package-lock.json, yarn.lock, etc. Supports wildcards or a list of file names for caching multiple dependencies.'