Skip to content

Conversation

priya-kinthali
Copy link
Contributor

@priya-kinthali priya-kinthali commented Aug 22, 2025

Description:
This PR improves the caching behaviour in setup-node by introducing enhanced logic for detecting and enabling caching based on the package manager field in package.json when the cache input is not explicitly set.

Key changes:

  • Updated the caching behaviour to be enabled by default when a packageManager field is detected in the package.json file and no cache input is provided.
  • Introduced a new input package-manager-cache to control this automatic caching behaviour. By default, package-manager-cache is set to true, enabling caching when a valid package manager field is detected. To disable this automatic caching, set package-manager-cache to false.
  • Updated documentation to reflect the new default caching behaviour and the addition of the package-manager-cache input.

Related issue:
#686

Check list:

  • Mark if documentation changes are required.
  • Mark if tests were added or updated to cover the changes.

@Copilot Copilot AI review requested due to automatic review settings August 22, 2025 11:11
@priya-kinthali priya-kinthali requested a review from a team as a code owner August 22, 2025 11:11
Copy link

@Copilot 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 enhances the caching functionality in setup-node by introducing automatic package manager detection from package.json fields when no explicit cache input is provided. The enhancement includes a new input parameter to control this behavior and updates documentation to reflect the new default caching approach.

  • Implements automatic package manager detection from packageManager and devEngines.packageManager fields in package.json
  • Adds package-manager-cache input parameter (default: true) to control automatic caching behavior
  • Updates documentation and adds comprehensive test coverage for the new functionality

Reviewed Changes

Copilot reviewed 6 out of 7 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/main.ts Implements core logic for package manager detection and automatic caching
action.yml Adds new package-manager-cache input parameter definition
README.md Updates documentation to describe new automatic caching behavior
tests/main.test.ts Adds comprehensive test coverage for automatic caching scenarios
.github/workflows/e2e-cache.yml Adds end-to-end test for package manager field detection
src/cache-save.ts Minor formatting change (empty line addition)

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@HarithaVattikuti HarithaVattikuti merged commit d7a1131 into actions:main Aug 26, 2025
479 of 484 checks passed
renovate bot added a commit to andrei-picus-tink/auto-renovate that referenced this pull request Sep 5, 2025
| datasource  | package            | from   | to     |
| ----------- | ------------------ | ------ | ------ |
| github-tags | actions/setup-node | v4.0.3 | v5.0.0 |


## [vv5.0.0](https://github.com/actions/setup-node/releases/tag/v5.0.0)

#### What's Changed

##### Breaking Changes

- Upgrade action to use node24 by [@salmanmkc](https://github.com/salmanmkc) in [#1325](actions/setup-node#1325)

Make sure your runner is updated to this version or newer to use this release. v2.327.1 [Release Notes](https://github.com/actions/runner/releases/tag/v2.327.1)

##### Dependency Upgrades

- Upgrade [@octokit/request-error](https://github.com/octokit/request-error) and [@actions/github](https://github.com/actions/github) by [@dependabot](https://github.com/dependabot)\[bot] in [#1227](actions/setup-node#1227)
- Upgrade uuid from 9.0.1 to 11.1.0 by [@dependabot](https://github.com/dependabot)\[bot] in [#1273](actions/setup-node#1273)
- Upgrade undici from 5.28.5 to 5.29.0 by [@dependabot](https://github.com/dependabot)\[bot] in [#1295](actions/setup-node#1295)
- Upgrade form-data to bring in fix for critical vulnerability by [@gowridurgad](https://github.com/gowridurgad) in [#1332](actions/setup-node#1332)
- Upgrade actions/checkout from 4 to 5 by [@dependabot](https://github.com/dependabot)\[bot] in [#1345](actions/setup-node#1345)

##### Enhancement:

- Enhance caching in setup-node with automatic package manager detection by [@priya-kinthali](https://github.com/priya-kinthali) in [#1348](actions/setup-node#1348)

#### New Contributors

- [@priya-kinthali](https://github.com/priya-kinthali) made their first contribution in [#1348](actions/setup-node#1348)
- [@salmanmkc](https://github.com/salmanmkc) made their first contribution in [#1325](actions/setup-node#1325)

**Full Changelog**: <actions/setup-node@v4...v5.0.0>


## [vv4.4.0](https://github.com/actions/setup-node/releases/tag/v4.4.0)

##### What's Changed

##### Bug fixes:

- Make eslint-compact matcher compatible with Stylelint by [@FloEdelmann](https://github.com/FloEdelmann) in [#98](actions/setup-node#98)
- Add support for indented eslint output by [@fregante](https://github.com/fregante) in [#1245](actions/setup-node#1245)

##### Enhancement:

- Support private mirrors by [@marco-ippolito](https://github.com/marco-ippolito) in [#1240](actions/setup-node#1240)

##### Dependency update:

- Upgrade [@action/cache](https://github.com/action/cache) from 4.0.2 to 4.0.3 by [@aparnajyothi-y](https://github.com/aparnajyothi-y) in [#1262](actions/setup-node#1262)

##### New Contributors

- [@FloEdelmann](https://github.com/FloEdelmann) made their first contribution in [#98](actions/setup-node#98)
- [@fregante](https://github.com/fregante) made their first contribution in [#1245](actions/setup-node#1245)
- [@marco-ippolito](https://github.com/marco-ippolito) made their first contribution in [#1240](actions/setup-node#1240)

**Full Changelog**: <actions/setup-node@v4...v4.4.0>


## [vv4.3.0](https://github.com/actions/setup-node/releases/tag/v4.3.0)

#### What's Changed

##### Dependency updates

- Upgrade [@actions/glob](https://github.com/actions/glob) from 0.4.0 to 0.5.0 by [@dependabot](https://github.com/dependabot) in [#1200](actions/setup-node#1200)
- Upgrade [@action/cache](https://github.com/action/cache) from 4.0.0 to 4.0.2 by [@gowridurgad](https://github.com/gowridurgad) in [#1251](actions/setup-node#1251)
- Upgrade [@vercel/ncc](https://github.com/vercel/ncc) from 0.38.1 to 0.38.3 by [@dependabot](https://github.com/dependabot) in [#1203](actions/setup-node#1203)
- Upgrade [@actions/tool-cache](https://github.com/actions/tool-cache) from 2.0.1 to 2.0.2 by [@dependabot](https://github.com/dependabot) in [#1220](actions/setup-node#1220)

#### New Contributors

- [@gowridurgad](https://github.com/gowridurgad) made their first contribution in [#1251](actions/setup-node#1251)

**Full Changelog**: <actions/setup-node@v4...v4.3.0>


## [vv4.2.0](https://github.com/actions/setup-node/releases/tag/v4.2.0)

#### What's Changed

- Enhance workflows and upgrade publish-actions from 0.2.2 to 0.3.0 by [@aparnajyothi-y](https://github.com/aparnajyothi-y) in [#1174](actions/setup-node#1174)
- Add recommended permissions section to readme by [@benwells](https://github.com/benwells) in [#1193](actions/setup-node#1193)
- Configure Dependabot settings by [@HarithaVattikuti](https://github.com/HarithaVattikuti) in [#1192](actions/setup-node#1192)
- Upgrade `@actions/cache` to `^4.0.0` by [@priyagupta108](https://github.com/priyagupta108) in [#1191](actions/setup-node#1191)
- Upgrade pnpm/action-setup from 2 to 4 by [@dependabot](https://github.com/dependabot) in [#1194](actions/setup-node#1194)
- Upgrade actions/publish-immutable-action from 0.0.3 to 0.0.4 by [@dependabot](https://github.com/dependabot) in [#1195](actions/setup-node#1195)
- Upgrade semver from 7.6.0 to 7.6.3 by [@dependabot](https://github.com/dependabot) in [#1196](actions/setup-node#1196)
- Upgrade [@types/jest](https://github.com/types/jest) from 29.5.12 to 29.5.14 by [@dependabot](https://github.com/dependabot) in [#1201](actions/setup-node#1201)
- Upgrade undici from 5.28.4 to 5.28.5 by [@dependabot](https://github.com/dependabot) in [#1205](actions/setup-node#1205)

#### New Contributors

- [@benwells](https://github.com/benwells) made their first contribution in [#1193](actions/setup-node#1193)

**Full Changelog**: <actions/setup-node@v4...v4.2.0>


## [vv4.1.0](https://github.com/actions/setup-node/releases/tag/v4.1.0)

#### What's Changed

- Resolve High Security Alerts by upgrading Dependencies by [@aparnajyothi-y](https://github.com/aparnajyothi-y) in [#1132](actions/setup-node#1132)
- Upgrade IA Publish by [@Jcambass](https://github.com/Jcambass) in [#1134](actions/setup-node#1134)
- Revise `isGhes` logic by [@jww3](https://github.com/jww3) in [#1148](actions/setup-node#1148)
- Add architecture to cache key by [@pengx17](https://github.com/pengx17) in [#843](actions/setup-node#843)
  This addresses issues with caching by adding the architecture (arch) to the cache key, ensuring that cache keys are accurate to prevent conflicts.
  Note: This change may break previous cache keys as they will no longer be compatible with the new format.

#### New Contributors

- [@jww3](https://github.com/jww3) made their first contribution in [#1148](actions/setup-node#1148)
- [@pengx17](https://github.com/pengx17) made their first contribution in [#843](actions/setup-node#843)

**Full Changelog**: <actions/setup-node@v4...v4.1.0>


## [vv4.0.4](https://github.com/actions/setup-node/releases/tag/v4.0.4)

##### What's Changed

- Add workflow file for publishing releases to immutable action package by [@Jcambass](https://github.com/Jcambass) in [#1125](actions/setup-node#1125)
- Enhance Windows ARM64 Setup and Update micromatch Dependency by [@priyagupta108](https://github.com/priyagupta108) in [#1126](actions/setup-node#1126)

##### Documentation changes:

- Documentation update in the README file by [@suyashgaonkar](https://github.com/suyashgaonkar) in [#1106](actions/setup-node#1106)
- Correct invalid 'lts' version string reference by [@fulldecent](https://github.com/fulldecent) in [#1124](actions/setup-node#1124)

##### New Contributors

- [@suyashgaonkar](https://github.com/suyashgaonkar) made their first contribution in [#1106](actions/setup-node#1106)
- [@priyagupta108](https://github.com/priyagupta108) made their first contribution in [#1126](actions/setup-node#1126)
- [@Jcambass](https://github.com/Jcambass) made their first contribution in [#1125](actions/setup-node#1125)
- [@fulldecent](https://github.com/fulldecent) made their first contribution in [#1124](actions/setup-node#1124)

**Full Changelog**: <actions/setup-node@v4...v4.0.4>
mergify bot added a commit to ArcadeData/arcadedb that referenced this pull request Sep 8, 2025
Bumps [actions/setup-node](https://github.com/actions/setup-node) from 4.4.0 to 5.0.0.
Release notes

*Sourced from [actions/setup-node's releases](https://github.com/actions/setup-node/releases).*

> v5.0.0
> ------
>
> What's Changed
> --------------
>
> ### Breaking Changes
>
> * Enhance caching in setup-node with automatic package manager detection by [`@​priya-kinthali`](https://github.com/priya-kinthali) in [actions/setup-node#1348](https://redirect.github.com/actions/setup-node/pull/1348)
>
> This update, introduces automatic caching when a valid `packageManager` field is present in your `package.json`. This aims to improve workflow performance and make dependency management more seamless. To disable this automatic caching,
> set `package-manager-cache: false`
>
> ```
> steps:
> - uses: actions/checkout@v5
> - uses: actions/setup-node@v5
>   with:
>     package-manager-cache: false
> ```
>
> * Upgrade action to use node24 by [`@​salmanmkc`](https://github.com/salmanmkc) in [actions/setup-node#1325](https://redirect.github.com/actions/setup-node/pull/1325)
>
> Make sure your runner is on version v2.327.1 or later to ensure compatibility with this release. [See Release Notes](https://github.com/actions/runner/releases/tag/v2.327.1)
>
> ### Dependency Upgrades
>
> * Upgrade `@​octokit/request-error` and `@​actions/github` by [`@​dependabot`](https://github.com/dependabot)[bot] in [actions/setup-node#1227](https://redirect.github.com/actions/setup-node/pull/1227)
> * Upgrade uuid from 9.0.1 to 11.1.0 by [`@​dependabot`](https://github.com/dependabot)[bot] in [actions/setup-node#1273](https://redirect.github.com/actions/setup-node/pull/1273)
> * Upgrade undici from 5.28.5 to 5.29.0 by [`@​dependabot`](https://github.com/dependabot)[bot] in [actions/setup-node#1295](https://redirect.github.com/actions/setup-node/pull/1295)
> * Upgrade form-data to bring in fix for critical vulnerability by [`@​gowridurgad`](https://github.com/gowridurgad) in [actions/setup-node#1332](https://redirect.github.com/actions/setup-node/pull/1332)
> * Upgrade actions/checkout from 4 to 5 by [`@​dependabot`](https://github.com/dependabot)[bot] in [actions/setup-node#1345](https://redirect.github.com/actions/setup-node/pull/1345)
>
> New Contributors
> ----------------
>
> * [`@​priya-kinthali`](https://github.com/priya-kinthali) made their first contribution in [actions/setup-node#1348](https://redirect.github.com/actions/setup-node/pull/1348)
> * [`@​salmanmkc`](https://github.com/salmanmkc) made their first contribution in [actions/setup-node#1325](https://redirect.github.com/actions/setup-node/pull/1325)
>
> **Full Changelog**: <actions/setup-node@v4...v5.0.0>


Commits

* [`a0853c2`](actions/setup-node@a0853c2) Bump actions/checkout from 4 to 5 ([#1345](https://redirect.github.com/actions/setup-node/issues/1345))
* [`b7234cc`](actions/setup-node@b7234cc) Upgrade action to use node24 ([#1325](https://redirect.github.com/actions/setup-node/issues/1325))
* [`d7a1131`](actions/setup-node@d7a1131) Enhance caching in setup-node with automatic package manager detection ([#1348](https://redirect.github.com/actions/setup-node/issues/1348))
* [`5e2628c`](actions/setup-node@5e2628c) Bumps form-data ([#1332](https://redirect.github.com/actions/setup-node/issues/1332))
* [`65becef`](actions/setup-node@65becef) Bump undici from 5.28.5 to 5.29.0 ([#1295](https://redirect.github.com/actions/setup-node/issues/1295))
* [`7e24a65`](actions/setup-node@7e24a65) Bump uuid from 9.0.1 to 11.1.0 ([#1273](https://redirect.github.com/actions/setup-node/issues/1273))
* [`08f58d1`](actions/setup-node@08f58d1) Bump `@​octokit/request-error` and `@​actions/github` ([#1227](https://redirect.github.com/actions/setup-node/issues/1227))
* See full diff in [compare view](actions/setup-node@49933ea...a0853c2)
  
[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility\_score?dependency-name=actions/setup-node&package-manager=github\_actions&previous-version=4.4.0&new-version=5.0.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)
Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.
[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)
---
Dependabot commands and options
  
You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot show  ignore conditions` will show all of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
mergify bot added a commit to robfrank/linklift that referenced this pull request Sep 8, 2025
Bumps [actions/setup-node](https://github.com/actions/setup-node) from 4 to 5.
Release notes

*Sourced from [actions/setup-node's releases](https://github.com/actions/setup-node/releases).*

> v5.0.0
> ------
>
> What's Changed
> --------------
>
> ### Breaking Changes
>
> * Enhance caching in setup-node with automatic package manager detection by [`@​priya-kinthali`](https://github.com/priya-kinthali) in [actions/setup-node#1348](https://redirect.github.com/actions/setup-node/pull/1348)
>
> This update, introduces automatic caching when a valid `packageManager` field is present in your `package.json`. This aims to improve workflow performance and make dependency management more seamless.
> To disable this automatic caching, set `package-manager-cache: false`
>
> ```
> steps:
> - uses: actions/checkout@v5
> - uses: actions/setup-node@v5
>   with:
>     package-manager-cache: false
> ```
>
> * Upgrade action to use node24 by [`@​salmanmkc`](https://github.com/salmanmkc) in [actions/setup-node#1325](https://redirect.github.com/actions/setup-node/pull/1325)
>
> Make sure your runner is on version v2.327.1 or later to ensure compatibility with this release. [See Release Notes](https://github.com/actions/runner/releases/tag/v2.327.1)
>
> ### Dependency Upgrades
>
> * Upgrade `@​octokit/request-error` and `@​actions/github` by [`@​dependabot`](https://github.com/dependabot)[bot] in [actions/setup-node#1227](https://redirect.github.com/actions/setup-node/pull/1227)
> * Upgrade uuid from 9.0.1 to 11.1.0 by [`@​dependabot`](https://github.com/dependabot)[bot] in [actions/setup-node#1273](https://redirect.github.com/actions/setup-node/pull/1273)
> * Upgrade undici from 5.28.5 to 5.29.0 by [`@​dependabot`](https://github.com/dependabot)[bot] in [actions/setup-node#1295](https://redirect.github.com/actions/setup-node/pull/1295)
> * Upgrade form-data to bring in fix for critical vulnerability by [`@​gowridurgad`](https://github.com/gowridurgad) in [actions/setup-node#1332](https://redirect.github.com/actions/setup-node/pull/1332)
> * Upgrade actions/checkout from 4 to 5 by [`@​dependabot`](https://github.com/dependabot)[bot] in [actions/setup-node#1345](https://redirect.github.com/actions/setup-node/pull/1345)
>
> New Contributors
> ----------------
>
> * [`@​priya-kinthali`](https://github.com/priya-kinthali) made their first contribution in [actions/setup-node#1348](https://redirect.github.com/actions/setup-node/pull/1348)
> * [`@​salmanmkc`](https://github.com/salmanmkc) made their first contribution in [actions/setup-node#1325](https://redirect.github.com/actions/setup-node/pull/1325)
>
> **Full Changelog**: <actions/setup-node@v4...v5.0.0>
>
> v4.4.0
> ------
>
> What's Changed
> --------------
>
> ### Bug fixes:
>
> * Make eslint-compact matcher compatible with Stylelint by [`@​FloEdelmann`](https://github.com/FloEdelmann) in [actions/setup-node#98](https://redirect.github.com/actions/setup-node/pull/98)
> * Add support for indented eslint output by [`@​fregante`](https://github.com/fregante) in [actions/setup-node#1245](https://redirect.github.com/actions/setup-node/pull/1245)
>
> ### Enhancement:
>
> * Support private mirrors by [`@​marco-ippolito`](https://github.com/marco-ippolito) in [actions/setup-node#1240](https://redirect.github.com/actions/setup-node/pull/1240)
>
> ### Dependency update:
>
> * Upgrade `@​action/cache` from 4.0.2 to 4.0.3 by [`@​aparnajyothi-y`](https://github.com/aparnajyothi-y) in [actions/setup-node#1262](https://redirect.github.com/actions/setup-node/pull/1262)
>
> New Contributors
> ----------------
>
> * [`@​FloEdelmann`](https://github.com/FloEdelmann) made their first contribution in [actions/setup-node#98](https://redirect.github.com/actions/setup-node/pull/98)
> * [`@​fregante`](https://github.com/fregante) made their first contribution in [actions/setup-node#1245](https://redirect.github.com/actions/setup-node/pull/1245)
> * [`@​marco-ippolito`](https://github.com/marco-ippolito) made their first contribution in [actions/setup-node#1240](https://redirect.github.com/actions/setup-node/pull/1240)
>
> **Full Changelog**: <actions/setup-node@v4...v4.4.0>

... (truncated)


Commits

* [`a0853c2`](actions/setup-node@a0853c2) Bump actions/checkout from 4 to 5 ([#1345](https://redirect.github.com/actions/setup-node/issues/1345))
* [`b7234cc`](actions/setup-node@b7234cc) Upgrade action to use node24 ([#1325](https://redirect.github.com/actions/setup-node/issues/1325))
* [`d7a1131`](actions/setup-node@d7a1131) Enhance caching in setup-node with automatic package manager detection ([#1348](https://redirect.github.com/actions/setup-node/issues/1348))
* [`5e2628c`](actions/setup-node@5e2628c) Bumps form-data ([#1332](https://redirect.github.com/actions/setup-node/issues/1332))
* [`65becef`](actions/setup-node@65becef) Bump undici from 5.28.5 to 5.29.0 ([#1295](https://redirect.github.com/actions/setup-node/issues/1295))
* [`7e24a65`](actions/setup-node@7e24a65) Bump uuid from 9.0.1 to 11.1.0 ([#1273](https://redirect.github.com/actions/setup-node/issues/1273))
* [`08f58d1`](actions/setup-node@08f58d1) Bump `@​octokit/request-error` and `@​actions/github` ([#1227](https://redirect.github.com/actions/setup-node/issues/1227))
* See full diff in [compare view](actions/setup-node@v4...v5)
  
[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility\_score?dependency-name=actions/setup-node&package-manager=github\_actions&previous-version=4&new-version=5)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)
Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.
[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)
---
Dependabot commands and options
  
You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot show  ignore conditions` will show all of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
josephfrazier added a commit to josephfrazier/reported-web that referenced this pull request Sep 9, 2025
…dependency caching

See actions/setup-node#1348:

> **Description:** This PR improves the caching behaviour in setup-node by introducing enhanced logic for detecting and enabling caching based on the package manager field in package.json when the cache input is not explicitly set.
>
> Key changes:
>
>     * Updated the caching behaviour to be enabled by default when a `packageManager` field is detected in the `package.json` file and no `cache` input is provided.
>
>     * Introduced a new input `package-manager-cache` to control this automatic caching behaviour. By default, `package-manager-cache` is set to `true`, enabling caching when a valid package manager field is detected. To disable this automatic caching, set `package-manager-cache` to `false`.
>
>     * Updated documentation to reflect the new default caching behaviour and the addition of the `package-manager-cache` input.
josephfrazier added a commit to josephfrazier/reported-web that referenced this pull request Sep 9, 2025
* build(deps): bump actions/setup-node from 4 to 5

Bumps [actions/setup-node](https://github.com/actions/setup-node) from 4 to 5.
- [Release notes](https://github.com/actions/setup-node/releases)
- [Commits](actions/setup-node@v4...v5)

---
updated-dependencies:
- dependency-name: actions/setup-node
  dependency-version: '5'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

* Add `"packageManager": "yarn@1.22.22"` to package.json for GitHub CI dependency caching

See actions/setup-node#1348:

> **Description:** This PR improves the caching behaviour in setup-node by introducing enhanced logic for detecting and enabling caching based on the package manager field in package.json when the cache input is not explicitly set.
>
> Key changes:
>
>     * Updated the caching behaviour to be enabled by default when a `packageManager` field is detected in the `package.json` file and no `cache` input is provided.
>
>     * Introduced a new input `package-manager-cache` to control this automatic caching behaviour. By default, `package-manager-cache` is set to `true`, enabling caching when a valid package manager field is detected. To disable this automatic caching, set `package-manager-cache` to `false`.
>
>     * Updated documentation to reflect the new default caching behaviour and the addition of the `package-manager-cache` input.

* Change package.json `engines.npm` to `engines.yarn`

See https://dashboard.heroku.com/apps/reported-web-dependabot-caimh5/activity/builds/26daa6e1-cc6d-48c4-82f2-9f62e61053b1:

>     -----> Building on the Heroku-22 stack
>     -----> Using buildpacks:
>            1. heroku/nodejs
>            2. jontewks/puppeteer
>     -----> Node.js app detected
>     -----> Build failed
>      !     Multiple package managers declared in package.json
>            Installing dependencies using the wrong package manager can result in missing packages or subtle bugs
>            in production. Only one of the following fields should be used, all others should be removed:
>            - npm version detected in engines.npm (>=3.10.10)
>            - yarn version declared in packageManager (yarn@1.22.22)
>
>            https://devcenter.heroku.com/articles/nodejs-support
>      !     Push rejected, failed to compile Node.js app.
>      !     Push failed

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Joseph Frazier <1212jtraceur@gmail.com>
SukkaW added a commit to SukkaW/setup-node that referenced this pull request Sep 10, 2025
- Only enable package cache when the cache feature is availiable
- We don't read "package.json" if previous version "cache" field is used
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants