Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit c0d63fd

Browse files
committed
Debug: try context.payload to find fork
1 parent a6283b8 commit c0d63fd

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed

lib/init-action-post-helper.js

Lines changed: 3 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/init-action-post-helper.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/init-action-post-helper.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -188,9 +188,12 @@ export async function run(
188188
// We do not delete uploaded SARIFs if we're on a fork, as we're missing the
189189
// appropriate permissions.
190190
core.info(
191-
`github.context.payload is ${JSON.stringify(github.context.payload)}`,
191+
`github.context.payload.pull_reques?.head.repo.fork is ${github.context.payload.pull_request?.head.repo.fork}`,
192192
);
193-
if (process.env["CODEQL_ACTION_EXPECT_UPLOAD_FAILED_SARIF"] === "true") {
193+
if (
194+
process.env["CODEQL_ACTION_EXPECT_UPLOAD_FAILED_SARIF"] === "true" &&
195+
github.context.payload.pull_request?.head.repo.fork === "false"
196+
) {
194197
await removeUploadedSarif(uploadFailedSarifResult, logger);
195198
}
196199

0 commit comments

Comments
 (0)