mirror of
https://code.forgejo.org/actions/cache.git
synced 2025-04-21 16:23:56 +08:00
Fixed review comments and tests
This commit is contained in:
parent
5e7f2c1182
commit
91d7bd61be
10 changed files with 76 additions and 72 deletions
12
dist/restore-only/index.js
vendored
12
dist/restore-only/index.js
vendored
|
@ -4943,7 +4943,7 @@ exports.checkBypass = checkBypass;
|
|||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.stateToOutputMap = exports.RefKey = exports.Events = exports.State = exports.Outputs = exports.Inputs = void 0;
|
||||
exports.RefKey = exports.Events = exports.State = exports.Outputs = exports.Inputs = void 0;
|
||||
var Inputs;
|
||||
(function (Inputs) {
|
||||
Inputs["Key"] = "key";
|
||||
|
@ -4969,10 +4969,6 @@ var Events;
|
|||
Events["PullRequest"] = "pull_request";
|
||||
})(Events = exports.Events || (exports.Events = {}));
|
||||
exports.RefKey = "GITHUB_REF";
|
||||
exports.stateToOutputMap = new Map([
|
||||
[State.CacheMatchedKey, Outputs.CacheRestoreKey],
|
||||
[State.CachePrimaryKey, Outputs.CachePrimaryKey]
|
||||
]);
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
@ -9388,8 +9384,12 @@ exports.StateProvider = StateProvider;
|
|||
class NullStateProvider extends StateProviderBase {
|
||||
constructor() {
|
||||
super(...arguments);
|
||||
this.stateToOutputMap = new Map([
|
||||
[constants_1.State.CacheMatchedKey, constants_1.Outputs.CacheRestoreKey],
|
||||
[constants_1.State.CachePrimaryKey, constants_1.Outputs.CachePrimaryKey]
|
||||
]);
|
||||
this.setState = (key, value) => {
|
||||
core.setOutput(constants_1.stateToOutputMap.get(key), value);
|
||||
core.setOutput(this.stateToOutputMap.get(key), value);
|
||||
};
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
this.getState = (key) => "";
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue