Factor out test mode determination code

This commit is contained in:
Henry Mercer
2022-04-28 19:07:04 +01:00
parent 0c3c093eba
commit 7c2be06006
9 changed files with 27 additions and 12 deletions

View File

@@ -742,3 +742,12 @@ export async function checkActionVersion(version: string) {
}
}
}
/*
* Returns whether we are in test mode.
*
* In test mode, we don't upload SARIF results or status reports to the GitHub API.
*/
export function isInTestMode(): boolean {
return process.env["TEST_MODE"] === "true" || false;
}