Enhance caching in setup-node with automatic package manager detection by priya-kinthali · Pull Request #1348 · actions/setup-node

and others added 7 commits

December 11, 2023 18:20

Copilot AI review requested due to automatic review settings

August 22, 2025 11:11

@priya-kinthali

@priya-kinthali

aparnajyothi-y

mahabaleshwars

HarithaVattikuti

renovate bot added a commit to andrei-picus-tink/auto-renovate that referenced this pull request

Sep 5, 2025

mergify bot added a commit to ArcadeData/arcadedb that referenced this pull request

Sep 8, 2025

mergify bot added a commit to robfrank/linklift that referenced this pull request

Sep 8, 2025

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

pkuczynski referenced this pull request in typeorm/typeorm

Oct 3, 2025

renovate bot added a commit to andrei-picus-tink/auto-renovate that referenced this pull request

Oct 15, 2025

aparnajyothi-y pushed a commit to aparnajyothi-y/setup-node that referenced this pull request

Oct 21, 2025
actions#1348)

* setup node in local

* Enhance caching in setup-node with package manager filed detection

* updated with array

* update the field

renovate bot added a commit to andrei-picus-tink/auto-renovate that referenced this pull request

Dec 4, 2025

thekbb added a commit to thekbb/expand-aws-iam-wildcards that referenced this pull request

Dec 13, 2025
Upgrade github actions to latest
add `packageManager` to `package.json` should level up caching without additonal config
see: actions/setup-node#1348

renovate bot added a commit to andrei-picus-tink/auto-renovate that referenced this pull request

Jan 15, 2026

renovate bot added a commit to andrei-picus-tink/auto-renovate that referenced this pull request

Mar 8, 2026

This was referenced

Mar 13, 2026