Capture rate limit and ref not existing config errors
This commit is contained in:
parent
5a599c68cf
commit
fa75c144b4
6 changed files with 30 additions and 6 deletions
|
|
@ -5,10 +5,12 @@ import consoleLogLevel from "console-log-level";
|
|||
|
||||
import { getActionVersion, getRequiredInput } from "./actions-util";
|
||||
import {
|
||||
ConfigurationError,
|
||||
getRequiredEnvParam,
|
||||
GITHUB_DOTCOM_URL,
|
||||
GitHubVariant,
|
||||
GitHubVersion,
|
||||
isHTTPError,
|
||||
parseGitHubUrl,
|
||||
parseMatrixInput,
|
||||
} from "./util";
|
||||
|
|
@ -192,3 +194,15 @@ export function computeAutomationID(
|
|||
|
||||
return automationID;
|
||||
}
|
||||
|
||||
export function wrapApiConfigurationError(e: unknown) {
|
||||
if (isHTTPError(e)) {
|
||||
if (
|
||||
e.message.includes("API rate limit exceeded for site ID installation") ||
|
||||
/^ref .* not found in this repository$/.test(e.message)
|
||||
) {
|
||||
return new ConfigurationError(e.message);
|
||||
}
|
||||
}
|
||||
return e;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue