Skip to content

Commit afad33d

Browse files
committed
Treat status reports as non-critical
1 parent eab49d7 commit afad33d

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

src/status-report.ts

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -334,19 +334,19 @@ export async function sendStatusReport<S extends StatusReportBase>(
334334
getWorkflowEventName() === "push" &&
335335
process.env["GITHUB_ACTOR"] === "dependabot[bot]"
336336
) {
337-
core.setFailed(
337+
core.warning(
338338
'Workflows triggered by Dependabot on the "push" event run with read-only access. ' +
339339
"Uploading Code Scanning results requires write access. " +
340340
'To use Code Scanning with Dependabot, please ensure you are using the "pull_request" event for this workflow and avoid triggering on the "push" event for Dependabot branches. ' +
341341
"See https://docs.github.com/en/code-security/secure-coding/configuring-code-scanning#scanning-on-push for more information on how to configure these events.",
342342
);
343343
} else {
344-
core.setFailed(e.message || GENERIC_403_MSG);
344+
core.warning(e.message || GENERIC_403_MSG);
345345
}
346-
return false;
346+
return true;
347347
case 404:
348-
core.setFailed(GENERIC_404_MSG);
349-
return false;
348+
core.warning(GENERIC_404_MSG);
349+
return true;
350350
case 422:
351351
// schema incompatibility when reporting status
352352
// this means that this action version is no longer compatible with the API
@@ -362,9 +362,12 @@ export async function sendStatusReport<S extends StatusReportBase>(
362362

363363
// something else has gone wrong and the request/response will be logged by octokit
364364
// it's possible this is a transient error and we should continue scanning
365-
core.error(
365+
core.warning(
366366
"An unexpected error occurred when sending code scanning status report.",
367367
);
368+
} finally {
369+
// this API is private and it is not critical that it succeed:
370+
// https://github.com/github/codeql/issues/15462#issuecomment-1919186317
368371
return true;
369372
}
370373
}

0 commit comments

Comments
 (0)