mirror of
https://github.com/github/codeql-action.git
synced 2026-05-17 00:30:27 +00:00
Emit log message, capture non-PR runs
This commit is contained in:
Generated
+8
-5
@@ -115,11 +115,14 @@ async function run(uploadDatabaseBundleDebugArtifact, uploadLogsDebugArtifact, p
|
||||
throw new Error("Expected to upload a failed SARIF file for this CodeQL code scanning run, " +
|
||||
`but the result was instead ${error}.`);
|
||||
}
|
||||
// We do not delete uploaded SARIFs if we're on a fork, as we're missing the
|
||||
// appropriate permissions.
|
||||
if (process.env["CODEQL_ACTION_EXPECT_UPLOAD_FAILED_SARIF"] === "true" &&
|
||||
github.context.payload.pull_request?.head.repo.fork === false) {
|
||||
await removeUploadedSarif(uploadFailedSarifResult, logger);
|
||||
if (process.env["CODEQL_ACTION_EXPECT_UPLOAD_FAILED_SARIF"] === "true") {
|
||||
if (!github.context.payload.pull_request?.head.repo.fork) {
|
||||
await removeUploadedSarif(uploadFailedSarifResult, logger);
|
||||
}
|
||||
else {
|
||||
logger.info("Skipping deletion of failed SARIF because the workflow was triggered from a fork of " +
|
||||
"codeql-action and doesn't have the appropriate permissions for deletion.");
|
||||
}
|
||||
}
|
||||
// Upload appropriate Actions artifacts for debugging
|
||||
if (config.debugMode) {
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -184,13 +184,15 @@ export async function run(
|
||||
);
|
||||
}
|
||||
|
||||
// We do not delete uploaded SARIFs if we're on a fork, as we're missing the
|
||||
// appropriate permissions.
|
||||
if (
|
||||
process.env["CODEQL_ACTION_EXPECT_UPLOAD_FAILED_SARIF"] === "true" &&
|
||||
github.context.payload.pull_request?.head.repo.fork === false
|
||||
) {
|
||||
await removeUploadedSarif(uploadFailedSarifResult, logger);
|
||||
if (process.env["CODEQL_ACTION_EXPECT_UPLOAD_FAILED_SARIF"] === "true") {
|
||||
if (!github.context.payload.pull_request?.head.repo.fork) {
|
||||
await removeUploadedSarif(uploadFailedSarifResult, logger);
|
||||
} else {
|
||||
logger.info(
|
||||
"Skipping deletion of failed SARIF because the workflow was triggered from a fork of " +
|
||||
"codeql-action and doesn't have the appropriate permissions for deletion.",
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// Upload appropriate Actions artifacts for debugging
|
||||
|
||||
Reference in New Issue
Block a user