Skip to content

Commit

Permalink
added event validation function
Browse files Browse the repository at this point in the history
  • Loading branch information
h0x0er committed Sep 26, 2022
1 parent a29f682 commit 1670e27
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/cache.ts
Expand Up @@ -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]);
}

0 comments on commit 1670e27

Please sign in to comment.