mirror of
https://github.com/step-security/harden-runner.git
synced 2026-06-08 06:17:07 +00:00
added event validation function
This commit is contained in:
parent
a29f6823d1
commit
1670e27193
1 changed files with 5 additions and 0 deletions
|
|
@ -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]);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue