1
0
mirror of https://github.com/actions/cache.git synced 2025-12-17 20:48:59 +08:00

Compare commits

...

103 Commits

Author SHA1 Message Date
Salman Chishti
9255dc7a25 Merge pull request #1686 from actions/cache-v5.0.1-release
prepare release v5.0.1
2025-12-12 16:35:06 +00:00
Salman Muin Kayser Chishti
8ff5423e8b chore: release v5.0.1
- Bump version to 5.0.1
- Fix Node.js 24 punycode deprecation warning via @actions/cache@5.0.1
- Updates @azure/storage-blob to ^12.29.1

Related: #1685
2025-12-12 16:25:01 +00:00
Salman Chishti
9233019a15 Merge pull request #1685 from salmanmkc/node24-storage-blob-fix
fix: update @actions/cache for Node.js 24 punycode deprecation
2025-12-12 16:16:21 +00:00
Salman Muin Kayser Chishti
b975f2bb84 fix: add peer property to package-lock.json for dependencies 2025-12-12 16:02:25 +00:00
Salman Muin Kayser Chishti
d0a0e18134 fix: update license files for @actions/cache, fast-xml-parser, and strnum 2025-12-12 15:49:07 +00:00
Salman Muin Kayser Chishti
74de208dcf fix: update @actions/cache to ^5.0.1 for Node.js 24 punycode fix
Updates @actions/cache to version 5.0.1 which includes the @azure/storage-blob
update that fixes the punycode deprecation warning on Node.js 24.
2025-12-12 15:48:37 +00:00
Salman Muin Kayser Chishti
ac7f1152ea peer 2025-12-12 14:25:41 +00:00
Salman Muin Kayser Chishti
b0f846b50b fix: update @actions/cache with storage-blob fix for Node.js 24 punycode deprecation 2025-12-12 14:14:24 +00:00
Salman Chishti
a783357455 Merge pull request #1684 from actions/prepare-cache-v5-release
Prepare v5.0.0 release
2025-12-11 21:15:52 +00:00
Salman Muin Kayser Chishti
3bb0d78750 docs: highlight v5 runner requirement in releases 2025-12-11 21:12:24 +00:00
Salman Muin Kayser Chishti
054c1f2301 readme note 2025-12-11 21:11:33 +00:00
Salman Muin Kayser Chishti
07629789a8 docs: update README for v5 release with Node 24 and runner version requirements 2025-12-11 21:08:31 +00:00
Salman Muin Kayser Chishti
9e02f8fbde Prepare v5.0.0 release
- Bump package version to 5.0.0

- Add v5.0.0 release notes (Node.js 24 runtime + runner requirement)
2025-12-11 21:03:28 +00:00
Salman Chishti
ffd11d22fe Merge pull request #1630 from salmanmkc/node24
Upgrade to use node24
2025-12-11 20:25:44 +00:00
Salman Muin Kayser Chishti
5bb537bda8 undo readme changes 2025-12-11 18:41:05 +00:00
Salman Muin Kayser Chishti
94a1e4b342 chore: regenerate package-lock.json 2025-12-11 18:38:18 +00:00
Salman Muin Kayser Chishti
70a5ee3e57 chore: rebuild dist with version 4.3.0 2025-12-11 18:36:48 +00:00
Salman Muin Kayser Chishti
5267c61f02 chore: set version to 4.3.0 for prepare release PR 2025-12-11 18:35:54 +00:00
Salman Muin Kayser Chishti
1513bf9d27 chore: revert README to main branch state 2025-12-11 18:32:39 +00:00
Salman Muin Kayser Chishti
3b0346c531 Revert "docs: update README with v5 release notes"
This reverts commit fe92eaff4b.
2025-12-11 18:30:21 +00:00
Salman Muin Kayser Chishti
fe92eaff4b docs: update README with v5 release notes 2025-12-11 18:27:19 +00:00
Salman Muin Kayser Chishti
8070f1903a chore: bump version to 5.0.0 for Node.js 24 support 2025-12-11 18:20:55 +00:00
Salman Muin Kayser Chishti
1285d7de7c chore: update actions/checkout to v5 in workflow files 2025-12-11 18:15:27 +00:00
Salman Muin Kayser Chishti
6b1bb4d720 chore: rebuild dist with @actions/cache v5.0.0 2025-12-11 18:06:30 +00:00
Salman Muin Kayser Chishti
76fc20e7a9 chore: update license cache for @actions/cache v5.0.0 2025-12-11 18:05:36 +00:00
Salman Muin Kayser Chishti
a5b36459de chore: use published @actions/cache v5.0.0 2025-12-11 18:04:30 +00:00
Salman Muin Kayser Chishti
0062e4cc5f Extra dist change 2025-12-11 14:07:40 +00:00
Salman Muin Kayser Chishti
26b91aff41 Latest dist with core changes 2025-12-11 14:07:30 +00:00
Salman Muin Kayser Chishti
df217ffc5c chore: update @actions/core to 2.0.1 2025-12-11 14:06:40 +00:00
Salman Muin Kayser Chishti
d3cff5bce3 Update with core 2.0.1 which has exec 2.0.0 2025-12-11 14:04:55 +00:00
Salman Muin Kayser Chishti
a9d8a74065 chore: rebuild with @actions/cache v5.0.0
Uses updated cache package that removes @azure/ms-rest-js dependency to fix Node 24 punycode deprecation warning.
2025-12-10 11:12:44 +00:00
Salman Muin Kayser Chishti
249f0e6cee Use published @actions/core, exec, io v2.0.0 2025-12-09 16:15:56 +00:00
Salman Muin Kayser Chishti
aa3f06a4c2 Build with @actions/cache v5.0.0 2025-12-09 16:14:09 +00:00
Salman Muin Kayser Chishti
b24583c7e6 chore: use local @actions/core, exec, io packages 2025-12-09 11:13:31 +00:00
Salman Muin Kayser Chishti
5650dc9d27 chore: rebuild dist with local @actions/cache (core v2, exec v2) 2025-12-09 11:12:04 +00:00
Salman Muin Kayser Chishti
4803712a90 Build dist files for Node 24 2025-10-15 15:08:39 +01:00
Salman Muin Kayser Chishti
e92260483e Merge main branch and resolve conflicts
- Keep Node 24 package.json with local cache package reference
- Keep rebuilt dist files with local cache package
- Preserve package-lock.json with updated dependencies
- Include latest license updates from main
2025-09-29 15:42:16 +01:00
Salman Muin Kayser Chishti
5868a9c4a9 Update cache to use local cache package and Node 24 support
- Use local cache package with file:../packages/cache instead of published version
- Update all action.yml files to use node24 runtime
- Update dependencies to support Node 24 (@types/node@24.1.0)
- Rebuild dist files with local cache package
- Add engines field requiring node >=24
2025-09-29 15:26:42 +01:00
Bassem Dghaidi
0057852bfa Merge pull request #1655 from actions/Link-/prepare-4.3.0
Prepare `v4.3.0` release
2025-09-24 15:47:33 +02:00
Bassem Dghaidi
4f5ea67f1c Update licensed cache 2025-09-24 06:39:50 -07:00
Bassem Dghaidi
9fcad95d03 Upgrade actions/cache to 4.1.0 and prepare 4.3.0 release 2025-09-24 06:24:25 -07:00
Salman Muin Kayser Chishti
99f840292b Approve license 2025-08-13 21:51:16 +01:00
Salman Muin Kayser Chishti
d6693585a1 license and compiled 2025-08-13 21:46:44 +01:00
Salman Muin Kayser Chishti
941dee2241 Merge branch 'main' into pr/1630 2025-08-13 21:43:37 +01:00
Ryan Ghadimi
638ed79f9d Merge pull request #1642 from actions/GhadimiR-patch-1
Add note on runner versions
2025-08-11 12:17:46 +01:00
Ryan Ghadimi
3862dccb17 Add note on runner versions 2025-08-11 09:20:59 +01:00
Bassem Dghaidi
0400d5f644 Merge pull request #1636 from actions/Link-/release-4.2.4
Prepare release `4.2.4`
2025-08-07 14:47:42 +02:00
Bassem Dghaidi
374a27f269 Prepare release 4.2.4 2025-08-07 04:25:55 -07:00
Bassem Dghaidi
358a7306cd Merge pull request #1634 from actions/Link-/optimise-deps
Upgrade `@actions/cache` to `4.0.4` and move `@protobuf-ts/plugin` to dev depdencies
2025-08-06 22:25:01 +02:00
Bassem Dghaidi
2ee706ef74 Fix with another approach 2025-08-06 13:18:40 -07:00
Bassem Dghaidi
94f7b5d913 Fix bundle exec 2025-08-06 13:13:47 -07:00
Bassem Dghaidi
c36116c3f4 Fix the workflow to use licensed from source 2025-08-06 13:10:06 -07:00
Bassem Dghaidi
320fe7d56b Update the licensed workflow to use the latest version 2025-08-06 13:01:20 -07:00
Bassem Dghaidi
d81cc477d9 Add licensed output 2025-08-06 12:37:53 -07:00
Bassem Dghaidi
de243982c5 Add licensed output 2025-08-06 12:35:46 -07:00
Bassem Dghaidi
e7b6a9cc9d @protobuf-ts/plugin to dev dependencies 2025-08-06 12:21:30 -07:00
Salman Chishti
7e364f2770 update licences 2025-08-06 10:30:04 +00:00
Salman Chishti
94b8944262 update to node24 2025-07-24 20:07:06 +00:00
Ben De St Paer-Gotch
640a1c2554 Merge pull request #1620 from actions/nebuk89-patch-1
Update README.md
2025-06-17 14:18:22 +01:00
Ben De St Paer-Gotch
c45d39173a Update README.md 2025-06-16 10:08:03 +01:00
Salman Chishti
5a3ec84eff Merge pull request #1577 from salmanmkc/salmanmkc/4-test
Update to use @actions/cache 4.0.3 package & prepare for new release
2025-03-19 18:06:32 +00:00
Salman Chishti
7de21022a7 Update releases.md 2025-03-18 08:00:50 -07:00
Salman Chishti
76d40dd347 Update to use the latest version of the cache package to obfuscate the SAS 2025-03-18 07:58:36 -07:00
Salman Chishti
76dd5eb692 update cache with main 2025-03-18 03:43:02 -07:00
Salman Chishti
8c80c27c5e new package 2025-03-13 04:55:45 -07:00
Salman Chishti
45cfd0e7ff updates 2025-03-13 04:30:51 -07:00
Salman Chishti
edd449b9cf updated cache with latest changes 2025-03-12 03:22:00 -07:00
Salman Chishti
0576707e37 latest test before pr 2025-03-10 06:54:42 -07:00
Salman Chishti
3105dc9754 update 2025-03-10 04:27:54 -07:00
Salman Chishti
9450d42d15 mask 2025-03-10 04:24:44 -07:00
Salman Chishti
7d05b27fb9 update cache package to mask whole sas to the end of the line 2025-03-10 04:20:14 -07:00
Salman Chishti
507b84c6a6 artifact changes 2025-03-07 08:47:30 -08:00
Salman Chishti
f248408e15 type 2025-03-07 08:12:07 -08:00
Salman Chishti
c30eb5542e debugging 2025-03-07 08:06:30 -08:00
Salman Chishti
5b6ae99d8b mask whole url 2025-03-07 08:02:01 -08:00
Salman Chishti
eca7c65a55 changed 2025-03-07 08:00:03 -08:00
Salman Chishti
1b5d75f5cf add changes 2025-03-07 07:56:21 -08:00
Rob Herley
d4323d4df1 Merge pull request #1560 from actions/robherley/v4.2.2
Bump @actions/cache to v4.0.2
2025-02-27 09:47:05 -05:00
Rob Herley
da26677639 bump @actions/cache to v4.0.2, prep for v4.2.2 release 2025-02-26 12:45:56 -05:00
Rob Herley
7921ae235b Merge pull request #1557 from actions/robherley/ia-workflow-released
Update publish-immutable-actions.yml
2025-02-18 17:47:05 -05:00
Rob Herley
3937731706 Update publish-immutable-actions.yml 2025-02-18 17:43:49 -05:00
Rob Herley
0c907a75c2 Merge pull request #1554 from actions/robherley/v4.2.1
Bump @actions/cache to v4.0.1
2025-02-18 12:38:31 -05:00
Rob Herley
710893c236 bump @actions/cache to v4.0.1 2025-02-14 13:20:28 -05:00
Alessandro Sebastiani
9fa7e61ec7 Update force deletion docs due a recent deprecation (#1500)
* fix: update force deletion docs due a recent deprecation

* fix: applied josh's suggestions

---------

Co-authored-by: Josh Gross <joshmgross@github.com>
2025-02-12 10:49:34 -05:00
Tobbe Lundberg
36f1e144e1 docs: Make the "always save prime numbers" example more clear (#1525) 2025-01-09 23:36:56 +00:00
janco-absa
53aa38c736 Correct GitHub Spelling in caching-strategies.md (#1526)
GitHub was spelled incorrectly 3 lines under the Understanding how to choose path section
2025-01-06 16:55:00 +00:00
Bassem Dghaidi
1bd1e32a3b Merge pull request #1509 from actions/Link-/cache-4.2.0
Prepare release `v4.2.0`
2024-12-05 17:32:57 +01:00
Bassem Dghaidi
882d7ced4c Add 3.4.0 release notes 2024-12-05 04:30:22 -08:00
Bassem Dghaidi
f2695d7a42 Rerun CI 2024-12-05 03:40:40 -08:00
Bassem Dghaidi
f46ceeb60d Add licensed output 2024-12-04 13:44:43 -08:00
Bassem Dghaidi
e6f5858749 Add lodash to list of reviewed licenses 2024-12-04 12:58:41 -08:00
Bassem Dghaidi
4ae6f21c0d Add reviewed licensed packages 2024-12-04 12:26:01 -08:00
Bassem Dghaidi
c16df86586 Add licensed output 2024-12-04 12:08:14 -08:00
Bassem Dghaidi
b109c12f3b Upgrade @actions/core to 1.11.1 and other deps 2024-12-04 12:06:05 -08:00
Bassem Dghaidi
b7d227d702 Upgrade @vercel/ncc to 0.38.3 2024-12-04 11:59:05 -08:00
Bassem Dghaidi
faf639248d Update RELEASES.md 2024-12-04 11:49:23 -08:00
Bassem Dghaidi
4bc41c01bd Upgrade @actions/cache to 4.0.0 2024-12-04 11:32:28 -08:00
Bassem Dghaidi
6849a64899 Release 4.1.2 #1477
Prepare `4.1.2` release
2024-10-22 14:33:17 +02:00
Bassem Dghaidi
5a1720c49e Merge branch 'Link-/prep-4.1.2' of https://github.com/actions/cache into Link-/prep-4.1.2 2024-10-22 04:25:33 -07:00
Bassem Dghaidi
d9fef48d24 Merge branch 'main' into Link-/prep-4.1.2 2024-10-22 13:25:20 +02:00
Bassem Dghaidi
a50e8d027b Merge branch 'main' into Link-/prep-4.1.2 2024-10-22 04:24:43 -07:00
Bassem Dghaidi
1ea5f18c31 Merge branch 'main' into Link-/prep-4.1.2 2024-10-22 13:17:46 +02:00
Bassem Dghaidi
aa55e5f344 Prepare release 4.1.2 2024-10-22 03:54:14 -07:00
77 changed files with 319386 additions and 217986 deletions

View File

@@ -16,4 +16,4 @@ jobs:
name: Check dist/
uses: actions/reusable-workflows/.github/workflows/check-dist.yml@main
with:
node-version: "20.x"
node-version: "24.x"

View File

@@ -17,7 +17,7 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v4
uses: actions/checkout@v5
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL

View File

@@ -10,6 +10,31 @@ on:
workflow_dispatch:
jobs:
call-licensed:
name: Licensed
uses: actions/reusable-workflows/.github/workflows/licensed.yml@main
validate-cached-dependency-records:
runs-on: ubuntu-latest
name: Check licenses
steps:
- name: Checkout
uses: actions/checkout@v5
- name: Install dependencies
run: npm ci --ignore-scripts
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.1.7'
- name: Install licensed tool
run: |
cd "$RUNNER_TEMP"
curl -Lfs -o licensed.tar.gz https://github.com/licensee/licensed/archive/refs/tags/v5.0.4.tar.gz
tar -xzf licensed.tar.gz
cd licensed-5.0.4
bundle install
- name: Check cached dependency records
run: |
cd ${{ github.workspace }}
BUNDLE_GEMFILE=$RUNNER_TEMP/licensed-5.0.4/Gemfile bundle exec $RUNNER_TEMP/licensed-5.0.4/exe/licensed status

View File

@@ -2,7 +2,7 @@ name: 'Publish Immutable Action Version'
on:
release:
types: [published]
types: [released]
jobs:
publish:
@@ -14,7 +14,7 @@ jobs:
steps:
- name: Checking out
uses: actions/checkout@v4
uses: actions/checkout@v5
- name: Publish
id: publish
uses: actions/publish-immutable-action@0.0.3

View File

@@ -20,11 +20,11 @@ jobs:
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node.js 20.x
uses: actions/checkout@v5
- name: Setup Node.js 24.x
uses: actions/setup-node@v4
with:
node-version: 20.x
node-version: 24.x
cache: npm
- run: npm ci
- name: Prettier Format Check
@@ -43,7 +43,7 @@ jobs:
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v5
- name: Generate files in working directory
shell: bash
run: __tests__/create-cache-files.sh ${{ runner.os }} test-cache
@@ -66,7 +66,7 @@ jobs:
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v5
- name: Restore cache
uses: ./
with:
@@ -96,7 +96,7 @@ jobs:
https_proxy: http://squid-proxy:3128
steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v5
- name: Generate files
run: __tests__/create-cache-files.sh proxy test-cache
- name: Save cache
@@ -119,7 +119,7 @@ jobs:
https_proxy: http://squid-proxy:3128
steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v5
- name: Restore cache
uses: ./
with:

View File

@@ -1,6 +1,14 @@
sources:
npm: true
# Force UTF-8 encoding
encoding: 'utf-8'
# Ignore problematic packages with encoding issues
ignored:
npm:
- form-data
allowed:
- apache-2.0
- bsd-2-clause
@@ -13,4 +21,10 @@ allowed:
reviewed:
npm:
- sax
- sax
- "@protobuf-ts/plugin-framework" # Apache-2.0
- "@protobuf-ts/runtime" # Apache-2.0
- fs.realpath # ISC
- glob # ISC
- prettier # MIT
- lodash # MIT

BIN
.licenses/NOTICE generated Normal file

Binary file not shown.

Binary file not shown.

BIN
.licenses/npm/@actions/exec-2.0.0.dep.yml generated Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
.licenses/npm/@actions/io-2.0.0.dep.yml generated Normal file

Binary file not shown.

Binary file not shown.

BIN
.licenses/npm/@azure/core-client.dep.yml generated Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
.licenses/npm/@azure/core-xml.dep.yml generated Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
.licenses/npm/@protobuf-ts/runtime.dep.yml generated Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
.licenses/npm/debug.dep.yml generated Normal file

Binary file not shown.

Binary file not shown.

BIN
.licenses/npm/fast-xml-parser.dep.yml generated Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
.licenses/npm/https-proxy-agent.dep.yml generated Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -3,6 +3,7 @@
This action allows caching dependencies and build outputs to improve workflow execution time.
>Two other actions are available in addition to the primary `cache` action:
>
>* [Restore action](./restore/README.md)
>* [Save action](./save/README.md)
@@ -14,12 +15,42 @@ See ["Caching dependencies to speed up workflows"](https://docs.github.com/en/ac
## What's New
### ⚠️ Important changes
> [!IMPORTANT]
> `actions/cache@v5` runs on the Node.js 24 runtime and requires a minimum Actions Runner version of `2.327.1`.
> If you are using self-hosted runners, ensure they are updated before upgrading.
The cache backend service has been rewritten from the ground up for improved performance and reliability. [actions/cache](https://github.com/actions/cache) now integrates with the new cache service (v2) APIs.
The new service will gradually roll out as of **February 1st, 2025**. The legacy service will also be sunset on the same date. Changes in these releases are **fully backward compatible**.
**We are deprecating some versions of this action**. We recommend upgrading to version `v4` or `v3` as soon as possible before **February 1st, 2025.** (Upgrade instructions below).
If you are using pinned SHAs, please use the SHAs of versions `v4.2.0` or `v3.4.0`.
If you do not upgrade, all workflow runs using any of the deprecated [actions/cache](https://github.com/actions/cache) will fail.
Upgrading to the recommended versions will not break your workflows.
> **Additionally, if you are managing your own GitHub runners, you must update your runner version to `2.231.0` or newer to ensure compatibility with the new cache service.**
> Failure to update both the action version and your runner version may result in workflow failures after the migration date.
Read more about the change & access the migration guide: [reference to the announcement](https://github.com/actions/cache/discussions/1510).
### v5
* Updated to node 24
* Requires a minimum Actions Runner version of `2.327.1`
### v4
* Integrated with the new cache service (v2) APIs.
* Updated to node 20
### v3
* Integrated with the new cache service (v2) APIs.
* Added support for caching in GHES 3.5+.
* Fixed download issue for files > 2GB during restore.
* Updated the minimum runner version support from node 12 -> node 16.
@@ -47,6 +78,8 @@ Create a workflow `.yml` file in your repository's `.github/workflows` directory
If you are using this inside a container, a POSIX-compliant `tar` needs to be included and accessible from the execution path.
Note: `actions/cache@v5` runs on Node.js 24 and requires a minimum Actions Runner version of `2.327.1`.
If you are using a `self-hosted` Windows runner, `GNU tar` and `zstd` are required for [Cross-OS caching](https://github.com/actions/cache/blob/main/tips-and-workarounds.md#cross-os-cache) to work. They are also recommended to be installed in general so the performance is on par with `hosted` Windows runners.
### Inputs
@@ -316,10 +349,24 @@ There are a number of community practices/workarounds to fulfill specific requir
Please note that Windows environment variables (like `%LocalAppData%`) will NOT be expanded by this action. Instead, prefer using `~` in your paths which will expand to the HOME directory. For example, instead of `%LocalAppData%`, use `~\AppData\Local`. For a list of supported default environment variables, see the [Learn GitHub Actions: Variables](https://docs.github.com/en/actions/learn-github-actions/variables#default-environment-variables) page.
## Contributing
## Note
We would love for you to contribute to `actions/cache`. Pull requests are welcome! Please see the [CONTRIBUTING.md](CONTRIBUTING.md) for more information.
Thank you for your interest in this GitHub repo, however, right now we are not taking contributions.
We continue to focus our resources on strategic areas that help our customers be successful while making developers' lives easier. While GitHub Actions remains a key part of this vision, we are allocating resources towards other areas of Actions and are not taking contributions to this repository at this time. The GitHub public roadmap is the best place to follow along for any updates on features were working on and what stage theyre in.
We are taking the following steps to better direct requests related to GitHub Actions, including:
1. We will be directing questions and support requests to our [Community Discussions area](https://github.com/orgs/community/discussions/categories/actions)
2. High Priority bugs can be reported through Community Discussions or you can report these to our support team https://support.github.com/contact/bug-report.
3. Security Issues should be handled as per our [security.md](SECURITY.md).
We will still provide security updates for this project and fix major breaking changes during this time.
You are welcome to still raise bugs in this repo.
## License
The scripts and documentation in this project are released under the [MIT License](LICENSE)
The scripts and documentation in this project are released under the [MIT License](LICENSE)

View File

@@ -1,9 +1,62 @@
# Releases
## Changelog
### 5.0.1
- Update `@azure/storage-blob` to `^12.29.1` via `@actions/cache@5.0.1` [#1685](https://github.com/actions/cache/pull/1685)
### 5.0.0
> [!IMPORTANT]
> `actions/cache@v5` runs on the Node.js 24 runtime and requires a minimum Actions Runner version of `2.327.1`.
> If you are using self-hosted runners, ensure they are updated before upgrading.
### 4.3.0
- Bump `@actions/cache` to [v4.1.0](https://github.com/actions/toolkit/pull/2132)
### 4.2.4
- Bump `@actions/cache` to v4.0.5
### 4.2.3
- Bump `@actions/cache` to v4.0.3 (obfuscates SAS token in debug logs for cache entries)
### 4.2.2
- Bump `@actions/cache` to v4.0.2
### 4.2.1
- Bump `@actions/cache` to v4.0.1
### 4.2.0
TLDR; The cache backend service has been rewritten from the ground up for improved performance and reliability. [actions/cache](https://github.com/actions/cache) now integrates with the new cache service (v2) APIs.
The new service will gradually roll out as of **February 1st, 2025**. The legacy service will also be sunset on the same date. Changes in these release are **fully backward compatible**.
**We are deprecating some versions of this action**. We recommend upgrading to version `v4` or `v3` as soon as possible before **February 1st, 2025.** (Upgrade instructions below).
If you are using pinned SHAs, please use the SHAs of versions `v4.2.0` or `v3.4.0`
If you do not upgrade, all workflow runs using any of the deprecated [actions/cache](https://github.com/actions/cache) will fail.
Upgrading to the recommended versions will not break your workflows.
### 4.1.2
- Add GitHub Enterprise Cloud instances hostname filters to inform API endpoint choices - [#1474](https://github.com/actions/cache/pull/1474)
- Security fix: Bump braces from 3.0.2 to 3.0.3 - [#1475](https://github.com/actions/cache/pull/1475)
### 4.1.1
- Restore original behavior of `cache-hit` output - [#1467](https://github.com/actions/cache/pull/1467)
### 4.1.0
- Ensure `cache-hit` output is set when a cache is missed - [#1404](https://github.com/actions/cache/pull/1404)
- Deprecate `save-always` input - [#1452](https://github.com/actions/cache/pull/1452)
@@ -19,6 +72,10 @@
- Updated minimum runner version support from node 12 -> node 20
### 3.4.0
- Integrated with the new cache service (v2) APIs
### 3.3.3
- Updates @actions/cache to v3.2.3 to fix accidental mutated path arguments to `getCacheVersion` [actions/toolkit#1378](https://github.com/actions/toolkit/pull/1378)

View File

@@ -38,7 +38,7 @@ outputs:
cache-hit:
description: 'A boolean value to indicate an exact match was found for the primary key'
runs:
using: 'node20'
using: 'node24'
main: 'dist/restore/index.js'
post: 'dist/save/index.js'
post-if: "success()"

View File

@@ -102,7 +102,7 @@ The [GitHub Context](https://docs.github.com/en/actions/learn-github-actions/con
While setting paths for caching dependencies it is important to give correct path depending on the hosted runner you are using or whether the action is running in a container job. Assigning different `path` for save and restore will result in cache miss.
Below are GiHub hosted runner specific paths one should take care of when writing a workflow which saves/restores caches across OS.
Below are GitHub hosted runner specific paths one should take care of when writing a workflow which saves/restores caches across OS.
#### Ubuntu Paths

129713
dist/restore-only/index.js vendored

File diff suppressed because one or more lines are too long

129713
dist/restore/index.js vendored

File diff suppressed because one or more lines are too long

129713
dist/save-only/index.js vendored

File diff suppressed because one or more lines are too long

129713
dist/save/index.js vendored

File diff suppressed because one or more lines are too long

18251
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,6 +1,6 @@
{
"name": "cache",
"version": "4.1.1",
"version": "5.0.1",
"private": true,
"description": "Cache dependencies and build outputs",
"main": "dist/restore/index.js",
@@ -23,29 +23,32 @@
"author": "GitHub",
"license": "MIT",
"dependencies": {
"@actions/cache": "^3.2.3",
"@actions/core": "^1.10.0",
"@actions/exec": "^1.1.1",
"@actions/io": "^1.1.2"
"@actions/cache": "^5.0.1",
"@actions/core": "^2.0.0",
"@actions/exec": "^2.0.0",
"@actions/io": "^2.0.0"
},
"devDependencies": {
"@types/jest": "^27.5.2",
"@types/jest": "^29.5.14",
"@types/nock": "^11.1.0",
"@types/node": "^16.18.3",
"@typescript-eslint/eslint-plugin": "^5.45.0",
"@typescript-eslint/parser": "^5.45.0",
"@vercel/ncc": "^0.38.1",
"@types/node": "^24.1.0",
"@typescript-eslint/eslint-plugin": "^7.2.0",
"@typescript-eslint/parser": "^7.2.0",
"@vercel/ncc": "^0.38.3",
"eslint": "^8.28.0",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-import": "^2.26.0",
"eslint-plugin-jest": "^26.9.0",
"eslint-plugin-prettier": "^4.2.1",
"eslint-plugin-simple-import-sort": "^7.0.0",
"jest": "^28.1.3",
"jest-circus": "^27.5.1",
"eslint-config-prettier": "^9.1.2",
"eslint-plugin-import": "^2.32.0",
"eslint-plugin-jest": "^27.9.0",
"eslint-plugin-prettier": "^5.5.3",
"eslint-plugin-simple-import-sort": "^12.1.1",
"jest": "^29.7.0",
"jest-circus": "^29.7.0",
"nock": "^13.2.9",
"prettier": "^2.8.0",
"ts-jest": "^28.0.8",
"typescript": "^4.9.3"
"prettier": "^3.6.2",
"ts-jest": "^29.4.0",
"typescript": "^5.8.3"
},
"engines": {
"node": ">=24"
}
}
}

View File

@@ -31,7 +31,7 @@ outputs:
cache-matched-key:
description: 'Key of the cache that was restored, it could either be the primary key on cache-hit or a partial/complete match of one of the restore keys'
runs:
using: 'node20'
using: 'node24'
main: '../dist/restore-only/index.js'
branding:
icon: 'archive'

View File

@@ -79,8 +79,10 @@ To avoid saving a cache that already exists, the `cache-hit` output from a resto
The `cache-primary-key` output from the restore step should also be used to ensure
the cache key does not change during the build if it's calculated based on file contents.
Here's an example where we imagine we're calculating a lot of prime numbers and want to cache them:
```yaml
name: Always Caching Primes
name: Always Caching Prime Numbers
on: push
@@ -91,23 +93,23 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Restore cached Primes
id: cache-primes-restore
- name: Restore cached Prime Numbers
id: cache-prime-numbers-restore
uses: actions/cache/restore@v4
with:
key: ${{ runner.os }}-primes
key: ${{ runner.os }}-prime-numbers
path: |
path/to/dependencies
some/other/dependencies
# Intermediate workflow steps
- name: Always Save Primes
id: cache-primes-save
if: always() && steps.cache-primes-restore.outputs.cache-hit != 'true'
- name: Always Save Prime Numbers
id: cache-prime-numbers-save
if: always() && steps.cache-prime-numbers-restore.outputs.cache-hit != 'true'
uses: actions/cache/save@v4
with:
key: ${{ steps.cache-primes-restore.outputs.cache-primary-key }}
key: ${{ steps.cache-prime-numbers-restore.outputs.cache-primary-key }}
path: |
path/to/dependencies
some/other/dependencies

View File

@@ -16,7 +16,7 @@ inputs:
default: 'false'
required: false
runs:
using: 'node20'
using: 'node24'
main: '../dist/save-only/index.js'
branding:
icon: 'archive'

View File

@@ -37,9 +37,8 @@ From `v3.2.3` cache is cross-os compatible when `enableCrossOsArchive` input is
## Force deletion of caches overriding default cache eviction policy
Caches have [branch scope restriction](https://docs.github.com/en/actions/using-workflows/caching-dependencies-to-speed-up-workflows#restrictions-for-accessing-a-cache) in place. This means that if caches for a specific branch are using a lot of storage quota, it may result into more frequently used caches from `default` branch getting thrashed. For example, if there are many pull requests happening on a repo and are creating caches, these cannot be used in default branch scope but will still occupy a lot of space till they get cleaned up by [eviction policy](https://docs.github.com/en/actions/using-workflows/caching-dependencies-to-speed-up-workflows#usage-limits-and-eviction-policy). But sometime we want to clean them up on a faster cadence so as to ensure default branch is not thrashing. In order to achieve this, [gh-actions-cache cli](https://github.com/actions/gh-actions-cache/) can be used to delete caches for specific branches.
Caches have [branch scope restriction](https://docs.github.com/en/actions/using-workflows/caching-dependencies-to-speed-up-workflows#restrictions-for-accessing-a-cache) in place. This means that if caches for a specific branch are using a lot of storage quota, it may result into more frequently used caches from `default` branch getting thrashed. For example, if there are many pull requests happening on a repo and are creating caches, these cannot be used in default branch scope but will still occupy a lot of space till they get cleaned up by [eviction policy](https://docs.github.com/en/actions/using-workflows/caching-dependencies-to-speed-up-workflows#usage-limits-and-eviction-policy). But sometime we want to clean them up on a faster cadence so as to ensure default branch is not thrashing.
This workflow uses `gh-actions-cache` to delete all the caches created by a branch.
<details>
<summary>Example</summary>
@@ -60,29 +59,23 @@ jobs:
actions: write
contents: read
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Cleanup
run: |
gh extension install actions/gh-actions-cache
REPO=${{ github.repository }}
BRANCH=refs/pull/${{ github.event.pull_request.number }}/merge
echo "Fetching list of cache key"
cacheKeysForPR=$(gh actions-cache list -R $REPO -B $BRANCH | cut -f 1 )
cacheKeysForPR=$(gh cache list --ref $BRANCH --limit 100 --json id --jq '.[].id')
## Setting this to not fail the workflow while deleting cache keys.
## Setting this to not fail the workflow while deleting cache keys.
set +e
echo "Deleting caches..."
for cacheKey in $cacheKeysForPR
do
gh actions-cache delete $cacheKey -R $REPO -B $BRANCH --confirm
gh cache delete $cacheKey
done
echo "Done"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_REPO: ${{ github.repository }}
BRANCH: refs/pull/${{ github.event.pull_request.number }}/merge
```
</details>