mirror of
https://code.forgejo.org/actions/cache.git
synced 2025-04-22 16:53:57 +08:00
Merge dde36b38ea
into b44d6c5cbf
This commit is contained in:
commit
e9b65c3cba
8 changed files with 59 additions and 13 deletions
6
dist/save/index.js
vendored
6
dist/save/index.js
vendored
|
@ -4614,6 +4614,7 @@ var Inputs;
|
|||
var Outputs;
|
||||
(function (Outputs) {
|
||||
Outputs["CacheHit"] = "cache-hit";
|
||||
Outputs["CacheKey"] = "cache-key";
|
||||
})(Outputs = exports.Outputs || (exports.Outputs = {}));
|
||||
var State;
|
||||
(function (State) {
|
||||
|
@ -37444,8 +37445,9 @@ function isExactKeyMatch(key, cacheKey) {
|
|||
}) === 0);
|
||||
}
|
||||
exports.isExactKeyMatch = isExactKeyMatch;
|
||||
function setCacheState(state) {
|
||||
function setCacheState(state, key) {
|
||||
core.saveState(constants_1.State.CacheMatchedKey, state);
|
||||
core.setOutput(constants_1.Outputs.CacheKey, key);
|
||||
}
|
||||
exports.setCacheState = setCacheState;
|
||||
function setCacheHitOutput(isCacheHit) {
|
||||
|
@ -37455,7 +37457,7 @@ exports.setCacheHitOutput = setCacheHitOutput;
|
|||
function setOutputAndState(key, cacheKey) {
|
||||
setCacheHitOutput(isExactKeyMatch(key, cacheKey));
|
||||
// Store the matched cache key if it exists
|
||||
cacheKey && setCacheState(cacheKey);
|
||||
cacheKey && setCacheState(cacheKey, key);
|
||||
}
|
||||
exports.setOutputAndState = setOutputAndState;
|
||||
function getCacheState() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue