Compare commits

..

5 Commits

Author SHA1 Message Date
Timo Rothenpieler
5c96ac01bf Merge 4598e54d46 into 640a1c2554 2025-06-19 09:04:22 +02: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
Timo Rothenpieler
4598e54d46 Update dist 2025-04-15 20:05:59 +02:00
Timo Rothenpieler
f0a29e5cc9 Add option to re-evaluate cache key during post action 2025-04-15 20:03:58 +02:00
8 changed files with 40 additions and 14 deletions

View File

@@ -76,6 +76,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
@@ -335,9 +336,23 @@ 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

View File

@@ -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'

View File

@@ -64911,7 +64911,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) {

View File

@@ -64911,7 +64911,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) {

View File

@@ -64911,7 +64911,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) {
@@ -64996,8 +64997,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
View File

@@ -64911,7 +64911,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) {
@@ -64996,8 +64997,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;

View File

@@ -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 {

View File

@@ -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.`);