Skip to content

Commit

Permalink
Debug: try context.payload to find fork
Browse files Browse the repository at this point in the history
  • Loading branch information
angelapwen committed Jan 16, 2024
1 parent a6283b8 commit c0d63fd
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
5 changes: 3 additions & 2 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.

7 changes: 5 additions & 2 deletions src/init-action-post-helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -188,9 +188,12 @@ export async function run(
// We do not delete uploaded SARIFs if we're on a fork, as we're missing the
// appropriate permissions.
core.info(
`github.context.payload is ${JSON.stringify(github.context.payload)}`,
`github.context.payload.pull_reques?.head.repo.fork is ${github.context.payload.pull_request?.head.repo.fork}`,
);
if (process.env["CODEQL_ACTION_EXPECT_UPLOAD_FAILED_SARIF"] === "true") {
if (
process.env["CODEQL_ACTION_EXPECT_UPLOAD_FAILED_SARIF"] === "true" &&
github.context.payload.pull_request?.head.repo.fork === "false"
) {
await removeUploadedSarif(uploadFailedSarifResult, logger);
}

Expand Down

0 comments on commit c0d63fd

Please sign in to comment.