-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Add example for restore-only cache in documentation #1419
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add example for restore-only cache in documentation #1419
Conversation
There was a problem hiding this 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 adds documentation demonstrating how to achieve restore-only caching behavior with setup-node by using the actions/cache action directly. This addresses community feedback requesting a restore-only flag without introducing new functionality, instead showing users how to accomplish this with existing tools.
Key Changes:
- Added a "Restore-Only Cache" section with a complete workflow example
- Included explanatory note about the benefits of restore-only caching
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
|
Not sure why this was merged as this example will pretty much always fail. The key Note that runner architecture and package manager must be specified manually as the latter is not provided as action context, and the former, though provided as Furthermore, the provided path will also fail as caches (at least on Linux runners) are usually stored under Finally, the base action from |
| datasource | package | from | to | | ----------- | ------------------ | ------ | ------ | | github-tags | actions/setup-node | v4.0.3 | v6.1.0 | ## [vv6.1.0](https://github.com/actions/setup-node/releases/tag/v6.1.0) #### What's Changed ##### Enhancement: - Remove always-auth configuration handling by [@priyagupta108](https://github.com/priyagupta108) in [#1436](actions/setup-node#1436) ##### Dependency updates: - Upgrade [@actions/cache](https://github.com/actions/cache) from 4.0.3 to 4.1.0 by [@dependabot](https://github.com/dependabot)\[bot] in [#1384](actions/setup-node#1384) - Upgrade actions/checkout from 5 to 6 by [@dependabot](https://github.com/dependabot)\[bot] in [#1439](actions/setup-node#1439) - Upgrade js-yaml from 3.14.1 to 3.14.2 by [@dependabot](https://github.com/dependabot)\[bot] in [#1435](actions/setup-node#1435) ##### Documentation update: - Add example for restore-only cache in documentation by [@aparnajyothi-y](https://github.com/aparnajyothi-y) in [#1419](actions/setup-node#1419) **Full Changelog**: <actions/setup-node@v6...v6.1.0> ## [vv6.0.0](https://github.com/actions/setup-node/releases/tag/v6.0.0) ##### What's Changed **Breaking Changes** - Limit automatic caching to npm, update workflows and documentation by [@priyagupta108](https://github.com/priyagupta108) in [#1374](actions/setup-node#1374) **Dependency Upgrades** - Upgrade ts-jest from 29.1.2 to 29.4.1 and document breaking changes in v5 by [@dependabot](https://github.com/dependabot)\[bot] in [#1336](actions/setup-node#1336) - Upgrade prettier from 2.8.8 to 3.6.2 by [@dependabot](https://github.com/dependabot)\[bot] in [#1334](actions/setup-node#1334) - Upgrade actions/publish-action from 0.3.0 to 0.4.0 by [@dependabot](https://github.com/dependabot)\[bot] in [#1362](actions/setup-node#1362) **Full Changelog**: <actions/setup-node@v5...v6.0.0> ## [vv5.0.0](https://github.com/actions/setup-node/releases/tag/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 [#1348](actions/setup-node#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` ```yaml 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 [#1325](actions/setup-node#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](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) ##### 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>
## Release notes Sourced from actions/setup-node's releases. v6.1.0 What's Changed Enhancement: Remove always-auth configuration handling by @priyagupta108 in actions/setup-node#1436 Dependency updates: Upgrade @actions/cache from 4.0.3 to 4.1.0 by @dependabot[bot] in actions/setup-node#1384 Upgrade actions/checkout from 5 to 6 by @dependabot[bot] in actions/setup-node#1439 Upgrade js-yaml from 3.14.1 to 3.14.2 by @dependabot[bot] in actions/setup-node#1435 Documentation update: Add example for restore-only cache in documentation by @aparnajyothi-y in actions/setup-node#1419 Full Changelog: actions/setup-node@v6...v6.1.0 ## Commits 395ad32 Bump js-yaml from 3.14.1 to 3.14.2 (#1435) a4d2e2b Bump actions/checkout from 5 to 6 (#1439) b9b25d4 Remove always-auth configuration handling from action (#1436) 633bb92 Bump @actions/cache from 4.0.3 to 4.1.0 (#1384) dda4788 Add example for restore-only cache in documentation (#1419) See full diff in compare view  Issue-ID: CIMAN-33 Signed-off-by: dependabot[bot] <[email protected]> Signed-off-by: onap.gh2gerrit <[email protected]> Change-Id: I463988e51413333aa9cba61dff3ddd488312adb1 GitHub-PR: #145 GitHub-Hash: ef74739b14d5c224
[//]: # (dependabot-start)⚠️ \*\*Dependabot is rebasing this PR\*\*⚠️ Rebasing might not happen immediately, so don't worry if this takes some time. Note: if you make any changes to this PR yourself, they will take precedence over the rebase. --- [//]: # (dependabot-end) Bumps [actions/setup-node](https://github.com/actions/setup-node) from 6.0.0 to 6.1.0. Release notes *Sourced from [actions/setup-node's releases](https://github.com/actions/setup-node/releases).* > v6.1.0 > ------ > > What's Changed > -------------- > > ### Enhancement: > > * Remove always-auth configuration handling by [`@priyagupta108`](https://github.com/priyagupta108) in [actions/setup-node#1436](https://redirect.github.com/actions/setup-node/pull/1436) > > ### Dependency updates: > > * Upgrade `@actions/cache` from 4.0.3 to 4.1.0 by [`@dependabot`](https://github.com/dependabot)[bot] in [actions/setup-node#1384](https://redirect.github.com/actions/setup-node/pull/1384) > * Upgrade actions/checkout from 5 to 6 by [`@dependabot`](https://github.com/dependabot)[bot] in [actions/setup-node#1439](https://redirect.github.com/actions/setup-node/pull/1439) > * Upgrade js-yaml from 3.14.1 to 3.14.2 by [`@dependabot`](https://github.com/dependabot)[bot] in [actions/setup-node#1435](https://redirect.github.com/actions/setup-node/pull/1435) > > ### Documentation update: > > * Add example for restore-only cache in documentation by [`@aparnajyothi-y`](https://github.com/aparnajyothi-y) in [actions/setup-node#1419](https://redirect.github.com/actions/setup-node/pull/1419) > > **Full Changelog**: <actions/setup-node@v6...v6.1.0> Commits * [`395ad32`](actions/setup-node@395ad32) Bump js-yaml from 3.14.1 to 3.14.2 ([#1435](https://redirect.github.com/actions/setup-node/issues/1435)) * [`a4d2e2b`](actions/setup-node@a4d2e2b) Bump actions/checkout from 5 to 6 ([#1439](https://redirect.github.com/actions/setup-node/issues/1439)) * [`b9b25d4`](actions/setup-node@b9b25d4) Remove always-auth configuration handling from action ([#1436](https://redirect.github.com/actions/setup-node/issues/1436)) * [`633bb92`](actions/setup-node@633bb92) Bump `@actions/cache` from 4.0.3 to 4.1.0 ([#1384](https://redirect.github.com/actions/setup-node/issues/1384)) * [`dda4788`](actions/setup-node@dda4788) Add example for restore-only cache in documentation ([#1419](https://redirect.github.com/actions/setup-node/issues/1419)) * See full diff in [compare view](actions/setup-node@2028fbc...395ad32) [](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)
Description:
This PR adds documentation and an example workflow demonstrating how to achieve restore-only caching with setup-node using the actions/cache.
The update is based on community feedback from #663 (“Add option to restore cache only”), which proposed adding a restore-only flag to the action.
Instead of introducing new functionality, this documentation clarifies how users can already achieve this behavior using actions/cache.
Related issue:
#663
Check list: