-
Notifications
You must be signed in to change notification settings - Fork 403
Introduce CODEQL_ACTION_SKIP_SARIF_UPLOAD
#3180
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 4 commits
e0b9da7
882667e
11e4034
680b070
25c8db9
00a6e13
5dfb610
86b2ad6
1b09eb4
df65651
d05f225
1707898
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -764,12 +764,25 @@ export function isGoodVersion(versionSpec: string) { | |
/** | ||
* Returns whether we are in test mode. This is used by CodeQL Action PR checks. | ||
* | ||
* In test mode, we don't upload SARIF results or status reports to the GitHub API. | ||
* In test mode, we skip several uploads (SARIF results, status reports, DBs, ...). | ||
*/ | ||
export function isInTestMode(): boolean { | ||
return process.env[EnvVar.TEST_MODE] === "true"; | ||
} | ||
|
||
/** | ||
* Returns whether we specifically want to skip uploading SARIF files, and if so, why. | ||
*/ | ||
export function getSarifUploadSkipReason(): string | null { | ||
if (isInTestMode()) { | ||
return `SARIF upload is disabled via ${EnvVar.TEST_MODE}`; | ||
} | ||
if (process.env[EnvVar.SKIP_SARIF_UPLOAD] === "true") { | ||
return `SARIF upload is disabled via ${EnvVar.SKIP_SARIF_UPLOAD}`; | ||
} | ||
return null; | ||
} | ||
|
||
|
||
/** | ||
* Get the testing environment. | ||
* | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this comment is a bit stale now, ditto at the other
isInTestMode/shouldSkipSarifUpload
switch.