diff --git a/src/cache.ts b/src/cache.ts index 35a31c16..c1d25524 100644 --- a/src/cache.ts +++ b/src/cache.ts @@ -114,3 +114,8 @@ export enum CompressionMethod { ZstdWithoutLong = "zstd-without-long", Zstd = "zstd", } +// Refer: https://github.com/actions/cache/blob/12681847c623a9274356751fdf0a63576ff3f846/src/utils/actionUtils.ts#L53 +const RefKey = "GITHUB_REF"; +export function isValidEvent(): boolean { + return RefKey in process.env && Boolean(process.env[RefKey]); +} \ No newline at end of file