Skip to content

Commit

Permalink
Emit log message, capture non-PR runs
Browse files Browse the repository at this point in the history
  • Loading branch information
angelapwen committed Jan 16, 2024
1 parent b0b38b2 commit 648a31a
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 13 deletions.
13 changes: 8 additions & 5 deletions lib/init-action-post-helper.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/init-action-post-helper.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 9 additions & 7 deletions src/init-action-post-helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 648a31a

Please sign in to comment.