review-comments: refactor getActionsStatus to accept an extra parameter designating if the analysis is third-party

This commit is contained in:
Fotis Koutoulakis (@NlightNFotis)
2025-04-01 14:58:59 +01:00
parent 01f1a1f2c9
commit 55ee663d5f
30 changed files with 121 additions and 56 deletions

View File

@@ -245,12 +245,17 @@ export function wrapApiConfigurationError(e: unknown) {
if (
e.message.includes("API rate limit exceeded for installation") ||
e.message.includes("commit not found") ||
e.message.includes("Bad credentials") ||
e.message.includes("Not Found") ||
e.message.includes("Resource not accessible by integration") ||
/ref .* not found in this repository/.test(e.message)
) {
return new ConfigurationError(e.message);
} else if (
e.message.includes("Bad credentials") ||
e.message.includes("Not Found")
) {
return new ConfigurationError(
"Please check that your token is valid and has the required permissions: contents: read, security-events: write",
);
}
}
return e;