added event validation function

This commit is contained in:
h0x0er 2022-09-26 22:22:19 +05:30
commit 1670e27193

View file

@ -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]);
}