@ -1,6 +1,6 @@
|
||||
import * as core from "@actions/core"
|
||||
|
||||
import { Outputs, RefKey, State } from "../constants"
|
||||
import { RefKey, State } from "../constants"
|
||||
|
||||
export function isExactKeyMatch(key: string, cacheKey?: string): boolean {
|
||||
return !!(
|
||||
@ -15,16 +15,6 @@ export function setCacheState(state: string): void {
|
||||
core.saveState(State.CacheMatchedKey, state)
|
||||
}
|
||||
|
||||
export function setCacheHitOutput(isCacheHit: boolean): void {
|
||||
core.setOutput(Outputs.CacheHit, isCacheHit.toString())
|
||||
}
|
||||
|
||||
export function setOutputAndState(key: string, cacheKey?: string): void {
|
||||
setCacheHitOutput(isExactKeyMatch(key, cacheKey))
|
||||
// Store the matched cache key if it exists
|
||||
cacheKey && setCacheState(cacheKey)
|
||||
}
|
||||
|
||||
export function getCacheState(): string | undefined {
|
||||
const cacheKey = core.getState(State.CacheMatchedKey)
|
||||
if (cacheKey) {
|
||||
|
Reference in New Issue
Block a user