mirror of
https://code.forgejo.org/actions/cache.git
synced 2026-01-18 10:18:57 +00:00
Merge 783accdc1c into 9255dc7a25
This commit is contained in:
commit
796c7c6d08
10 changed files with 93 additions and 65 deletions
17
dist/restore-only/index.js
vendored
17
dist/restore-only/index.js
vendored
|
|
@ -44243,21 +44243,22 @@ class StateProviderBase {
|
|||
class StateProvider extends StateProviderBase {
|
||||
constructor() {
|
||||
super(...arguments);
|
||||
this.setState = core.saveState;
|
||||
this.setState = (key, value) => { core.saveState(key, value); stateToOutput(key, value); };
|
||||
this.getState = core.getState;
|
||||
}
|
||||
}
|
||||
exports.StateProvider = StateProvider;
|
||||
const stateToOutputMap = new Map([
|
||||
[constants_1.State.CacheMatchedKey, constants_1.Outputs.CacheMatchedKey],
|
||||
[constants_1.State.CachePrimaryKey, constants_1.Outputs.CachePrimaryKey]
|
||||
]);
|
||||
function stateToOutput(key, value) {
|
||||
core.setOutput(stateToOutputMap.get(key), value);
|
||||
}
|
||||
class NullStateProvider extends StateProviderBase {
|
||||
constructor() {
|
||||
super(...arguments);
|
||||
this.stateToOutputMap = new Map([
|
||||
[constants_1.State.CacheMatchedKey, constants_1.Outputs.CacheMatchedKey],
|
||||
[constants_1.State.CachePrimaryKey, constants_1.Outputs.CachePrimaryKey]
|
||||
]);
|
||||
this.setState = (key, value) => {
|
||||
core.setOutput(this.stateToOutputMap.get(key), value);
|
||||
};
|
||||
this.setState = stateToOutput;
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
this.getState = (key) => "";
|
||||
}
|
||||
|
|
|
|||
17
dist/restore/index.js
vendored
17
dist/restore/index.js
vendored
|
|
@ -44243,21 +44243,22 @@ class StateProviderBase {
|
|||
class StateProvider extends StateProviderBase {
|
||||
constructor() {
|
||||
super(...arguments);
|
||||
this.setState = core.saveState;
|
||||
this.setState = (key, value) => { core.saveState(key, value); stateToOutput(key, value); };
|
||||
this.getState = core.getState;
|
||||
}
|
||||
}
|
||||
exports.StateProvider = StateProvider;
|
||||
const stateToOutputMap = new Map([
|
||||
[constants_1.State.CacheMatchedKey, constants_1.Outputs.CacheMatchedKey],
|
||||
[constants_1.State.CachePrimaryKey, constants_1.Outputs.CachePrimaryKey]
|
||||
]);
|
||||
function stateToOutput(key, value) {
|
||||
core.setOutput(stateToOutputMap.get(key), value);
|
||||
}
|
||||
class NullStateProvider extends StateProviderBase {
|
||||
constructor() {
|
||||
super(...arguments);
|
||||
this.stateToOutputMap = new Map([
|
||||
[constants_1.State.CacheMatchedKey, constants_1.Outputs.CacheMatchedKey],
|
||||
[constants_1.State.CachePrimaryKey, constants_1.Outputs.CachePrimaryKey]
|
||||
]);
|
||||
this.setState = (key, value) => {
|
||||
core.setOutput(this.stateToOutputMap.get(key), value);
|
||||
};
|
||||
this.setState = stateToOutput;
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
this.getState = (key) => "";
|
||||
}
|
||||
|
|
|
|||
17
dist/save-only/index.js
vendored
17
dist/save-only/index.js
vendored
|
|
@ -44256,21 +44256,22 @@ class StateProviderBase {
|
|||
class StateProvider extends StateProviderBase {
|
||||
constructor() {
|
||||
super(...arguments);
|
||||
this.setState = core.saveState;
|
||||
this.setState = (key, value) => { core.saveState(key, value); stateToOutput(key, value); };
|
||||
this.getState = core.getState;
|
||||
}
|
||||
}
|
||||
exports.StateProvider = StateProvider;
|
||||
const stateToOutputMap = new Map([
|
||||
[constants_1.State.CacheMatchedKey, constants_1.Outputs.CacheMatchedKey],
|
||||
[constants_1.State.CachePrimaryKey, constants_1.Outputs.CachePrimaryKey]
|
||||
]);
|
||||
function stateToOutput(key, value) {
|
||||
core.setOutput(stateToOutputMap.get(key), value);
|
||||
}
|
||||
class NullStateProvider extends StateProviderBase {
|
||||
constructor() {
|
||||
super(...arguments);
|
||||
this.stateToOutputMap = new Map([
|
||||
[constants_1.State.CacheMatchedKey, constants_1.Outputs.CacheMatchedKey],
|
||||
[constants_1.State.CachePrimaryKey, constants_1.Outputs.CachePrimaryKey]
|
||||
]);
|
||||
this.setState = (key, value) => {
|
||||
core.setOutput(this.stateToOutputMap.get(key), value);
|
||||
};
|
||||
this.setState = stateToOutput;
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
this.getState = (key) => "";
|
||||
}
|
||||
|
|
|
|||
17
dist/save/index.js
vendored
17
dist/save/index.js
vendored
|
|
@ -44256,21 +44256,22 @@ class StateProviderBase {
|
|||
class StateProvider extends StateProviderBase {
|
||||
constructor() {
|
||||
super(...arguments);
|
||||
this.setState = core.saveState;
|
||||
this.setState = (key, value) => { core.saveState(key, value); stateToOutput(key, value); };
|
||||
this.getState = core.getState;
|
||||
}
|
||||
}
|
||||
exports.StateProvider = StateProvider;
|
||||
const stateToOutputMap = new Map([
|
||||
[constants_1.State.CacheMatchedKey, constants_1.Outputs.CacheMatchedKey],
|
||||
[constants_1.State.CachePrimaryKey, constants_1.Outputs.CachePrimaryKey]
|
||||
]);
|
||||
function stateToOutput(key, value) {
|
||||
core.setOutput(stateToOutputMap.get(key), value);
|
||||
}
|
||||
class NullStateProvider extends StateProviderBase {
|
||||
constructor() {
|
||||
super(...arguments);
|
||||
this.stateToOutputMap = new Map([
|
||||
[constants_1.State.CacheMatchedKey, constants_1.Outputs.CacheMatchedKey],
|
||||
[constants_1.State.CachePrimaryKey, constants_1.Outputs.CachePrimaryKey]
|
||||
]);
|
||||
this.setState = (key, value) => {
|
||||
core.setOutput(this.stateToOutputMap.get(key), value);
|
||||
};
|
||||
this.setState = stateToOutput;
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
this.getState = (key) => "";
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue