1
0
Fork 0
mirror of https://code.forgejo.org/actions/cache.git synced 2024-11-15 03:11:17 +01:00

added stateprovider changes

This commit is contained in:
Sankalp Kotewar 2022-12-12 07:28:12 +00:00 committed by GitHub
parent 91d7bd61be
commit c0cc8dd60a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,6 +1,6 @@
import * as core from "@actions/core";
import { State, stateToOutputMap } from "./constants";
import { Outputs, State } from "./constants";
export interface IStateProvider {
setState(key: string, value: string): void;
@ -33,8 +33,13 @@ export class StateProvider extends StateProviderBase {
}
export class NullStateProvider extends StateProviderBase {
stateToOutputMap = new Map<string, string>([
[State.CacheMatchedKey, Outputs.CacheRestoreKey],
[State.CachePrimaryKey, Outputs.CachePrimaryKey]
]);
setState = (key: string, value: string) => {
core.setOutput(stateToOutputMap.get(key) as string, value);
core.setOutput(this.stateToOutputMap.get(key) as string, value);
};
// eslint-disable-next-line @typescript-eslint/no-unused-vars
getState = (key: string) => "";