mirror of
https://github.com/actions/cache.git
synced 2026-06-23 17:43:50 +08:00
Compare commits
5 Commits
v4.2.4
...
be9065e5df
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
be9065e5df | ||
|
|
638ed79f9d | ||
|
|
3862dccb17 | ||
|
|
4598e54d46 | ||
|
|
f0a29e5cc9 |
@@ -19,16 +19,19 @@ See ["Caching dependencies to speed up workflows"](https://docs.github.com/en/ac
|
||||
|
||||
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**.
|
||||
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 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).
|
||||
|
||||
### v4
|
||||
@@ -76,6 +79,7 @@ If you are using a `self-hosted` Windows runner, `GNU tar` and `zstd` are requir
|
||||
* `enableCrossOsArchive` - An optional boolean when enabled, allows Windows runners to save or restore caches that can be restored or saved respectively on other platforms. Default: `false`
|
||||
* `fail-on-cache-miss` - Fail the workflow if cache entry is not found. Default: `false`
|
||||
* `lookup-only` - If true, only checks if cache entry exists and skips download. Does not change save cache behavior. Default: `false`
|
||||
* `reeval-key` - A boolean which causes the key to be re-evaluated during the Post-Action step
|
||||
|
||||
#### Environment Variables
|
||||
|
||||
|
||||
@@ -34,6 +34,10 @@ inputs:
|
||||
save-always does not work as intended and will be removed in a future release.
|
||||
A separate `actions/cache/restore` step should be used instead.
|
||||
See https://github.com/actions/cache/tree/main/save#always-save-cache for more details.
|
||||
reeval-key:
|
||||
description: 'Re-evaluate the cache key during the post-action'
|
||||
required: false
|
||||
default: false
|
||||
outputs:
|
||||
cache-hit:
|
||||
description: 'A boolean value to indicate an exact match was found for the primary key'
|
||||
|
||||
3
dist/restore-only/index.js
vendored
3
dist/restore-only/index.js
vendored
@@ -66035,7 +66035,8 @@ var Inputs;
|
||||
Inputs["UploadChunkSize"] = "upload-chunk-size";
|
||||
Inputs["EnableCrossOsArchive"] = "enableCrossOsArchive";
|
||||
Inputs["FailOnCacheMiss"] = "fail-on-cache-miss";
|
||||
Inputs["LookupOnly"] = "lookup-only"; // Input for cache, restore action
|
||||
Inputs["LookupOnly"] = "lookup-only";
|
||||
Inputs["ReEvalKey"] = "reeval-key";
|
||||
})(Inputs = exports.Inputs || (exports.Inputs = {}));
|
||||
var Outputs;
|
||||
(function (Outputs) {
|
||||
|
||||
3
dist/restore/index.js
vendored
3
dist/restore/index.js
vendored
@@ -66035,7 +66035,8 @@ var Inputs;
|
||||
Inputs["UploadChunkSize"] = "upload-chunk-size";
|
||||
Inputs["EnableCrossOsArchive"] = "enableCrossOsArchive";
|
||||
Inputs["FailOnCacheMiss"] = "fail-on-cache-miss";
|
||||
Inputs["LookupOnly"] = "lookup-only"; // Input for cache, restore action
|
||||
Inputs["LookupOnly"] = "lookup-only";
|
||||
Inputs["ReEvalKey"] = "reeval-key";
|
||||
})(Inputs = exports.Inputs || (exports.Inputs = {}));
|
||||
var Outputs;
|
||||
(function (Outputs) {
|
||||
|
||||
8
dist/save-only/index.js
vendored
8
dist/save-only/index.js
vendored
@@ -66035,7 +66035,8 @@ var Inputs;
|
||||
Inputs["UploadChunkSize"] = "upload-chunk-size";
|
||||
Inputs["EnableCrossOsArchive"] = "enableCrossOsArchive";
|
||||
Inputs["FailOnCacheMiss"] = "fail-on-cache-miss";
|
||||
Inputs["LookupOnly"] = "lookup-only"; // Input for cache, restore action
|
||||
Inputs["LookupOnly"] = "lookup-only";
|
||||
Inputs["ReEvalKey"] = "reeval-key";
|
||||
})(Inputs = exports.Inputs || (exports.Inputs = {}));
|
||||
var Outputs;
|
||||
(function (Outputs) {
|
||||
@@ -66120,8 +66121,9 @@ function saveImpl(stateProvider) {
|
||||
}
|
||||
// If restore has stored a primary key in state, reuse that
|
||||
// Else re-evaluate from inputs
|
||||
const primaryKey = stateProvider.getState(constants_1.State.CachePrimaryKey) ||
|
||||
core.getInput(constants_1.Inputs.Key);
|
||||
const primaryKey = core.getBooleanInput(constants_1.Inputs.ReEvalKey)
|
||||
? core.getInput(constants_1.Inputs.Key)
|
||||
: (stateProvider.getState(constants_1.State.CachePrimaryKey) || core.getInput(constants_1.Inputs.Key));
|
||||
if (!primaryKey) {
|
||||
utils.logWarning(`Key is not specified.`);
|
||||
return;
|
||||
|
||||
8
dist/save/index.js
vendored
8
dist/save/index.js
vendored
@@ -66035,7 +66035,8 @@ var Inputs;
|
||||
Inputs["UploadChunkSize"] = "upload-chunk-size";
|
||||
Inputs["EnableCrossOsArchive"] = "enableCrossOsArchive";
|
||||
Inputs["FailOnCacheMiss"] = "fail-on-cache-miss";
|
||||
Inputs["LookupOnly"] = "lookup-only"; // Input for cache, restore action
|
||||
Inputs["LookupOnly"] = "lookup-only";
|
||||
Inputs["ReEvalKey"] = "reeval-key";
|
||||
})(Inputs = exports.Inputs || (exports.Inputs = {}));
|
||||
var Outputs;
|
||||
(function (Outputs) {
|
||||
@@ -66120,8 +66121,9 @@ function saveImpl(stateProvider) {
|
||||
}
|
||||
// If restore has stored a primary key in state, reuse that
|
||||
// Else re-evaluate from inputs
|
||||
const primaryKey = stateProvider.getState(constants_1.State.CachePrimaryKey) ||
|
||||
core.getInput(constants_1.Inputs.Key);
|
||||
const primaryKey = core.getBooleanInput(constants_1.Inputs.ReEvalKey)
|
||||
? core.getInput(constants_1.Inputs.Key)
|
||||
: (stateProvider.getState(constants_1.State.CachePrimaryKey) || core.getInput(constants_1.Inputs.Key));
|
||||
if (!primaryKey) {
|
||||
utils.logWarning(`Key is not specified.`);
|
||||
return;
|
||||
|
||||
@@ -5,7 +5,8 @@ export enum Inputs {
|
||||
UploadChunkSize = "upload-chunk-size", // Input for cache, save action
|
||||
EnableCrossOsArchive = "enableCrossOsArchive", // Input for cache, restore, save action
|
||||
FailOnCacheMiss = "fail-on-cache-miss", // Input for cache, restore action
|
||||
LookupOnly = "lookup-only" // Input for cache, restore action
|
||||
LookupOnly = "lookup-only", // Input for cache, restore action
|
||||
ReEvalKey = "reeval-key"
|
||||
}
|
||||
|
||||
export enum Outputs {
|
||||
|
||||
@@ -34,9 +34,9 @@ export async function saveImpl(
|
||||
|
||||
// If restore has stored a primary key in state, reuse that
|
||||
// Else re-evaluate from inputs
|
||||
const primaryKey =
|
||||
stateProvider.getState(State.CachePrimaryKey) ||
|
||||
core.getInput(Inputs.Key);
|
||||
const primaryKey = core.getBooleanInput(Inputs.ReEvalKey)
|
||||
? core.getInput(Inputs.Key)
|
||||
: (stateProvider.getState(State.CachePrimaryKey) || core.getInput(Inputs.Key));
|
||||
|
||||
if (!primaryKey) {
|
||||
utils.logWarning(`Key is not specified.`);
|
||||
|
||||
Reference in New Issue
Block a user