mirror of
https://github.com/github/codeql-action.git
synced 2026-04-26 16:58:47 +00:00
Turn enablement errors into configuration errors
This commit is contained in:
Generated
+12
@@ -83621,6 +83621,13 @@ async function deleteActionsCache(id) {
|
||||
cache_id: id
|
||||
});
|
||||
}
|
||||
function isEnablementError(msg) {
|
||||
return [
|
||||
/Code Security must be enabled/,
|
||||
/Advanced Security must be enabled/,
|
||||
/Code Scanning is not enabled/
|
||||
].some((pattern) => pattern.test(msg));
|
||||
}
|
||||
function wrapApiConfigurationError(e) {
|
||||
const httpError = asHTTPError(e);
|
||||
if (httpError !== void 0) {
|
||||
@@ -83637,6 +83644,11 @@ function wrapApiConfigurationError(e) {
|
||||
"Please check that your token is valid and has the required permissions: contents: read, security-events: write"
|
||||
);
|
||||
}
|
||||
if (isEnablementError(httpError.message)) {
|
||||
return new ConfigurationError(
|
||||
`Please verify that the necessary features are enabled: ${httpError.message}`
|
||||
);
|
||||
}
|
||||
if (httpError.status === 429) {
|
||||
return new ConfigurationError("API rate limit exceeded");
|
||||
}
|
||||
|
||||
Generated
+12
@@ -116758,6 +116758,13 @@ async function listActionsCaches(key, ref) {
|
||||
}
|
||||
);
|
||||
}
|
||||
function isEnablementError(msg) {
|
||||
return [
|
||||
/Code Security must be enabled/,
|
||||
/Advanced Security must be enabled/,
|
||||
/Code Scanning is not enabled/
|
||||
].some((pattern) => pattern.test(msg));
|
||||
}
|
||||
function wrapApiConfigurationError(e) {
|
||||
const httpError = asHTTPError(e);
|
||||
if (httpError !== void 0) {
|
||||
@@ -116774,6 +116781,11 @@ function wrapApiConfigurationError(e) {
|
||||
"Please check that your token is valid and has the required permissions: contents: read, security-events: write"
|
||||
);
|
||||
}
|
||||
if (isEnablementError(httpError.message)) {
|
||||
return new ConfigurationError(
|
||||
`Please verify that the necessary features are enabled: ${httpError.message}`
|
||||
);
|
||||
}
|
||||
if (httpError.status === 429) {
|
||||
return new ConfigurationError("API rate limit exceeded");
|
||||
}
|
||||
|
||||
Generated
+12
@@ -80926,6 +80926,13 @@ async function getRepositoryProperties(repositoryNwo) {
|
||||
repo: repositoryNwo.repo
|
||||
});
|
||||
}
|
||||
function isEnablementError(msg) {
|
||||
return [
|
||||
/Code Security must be enabled/,
|
||||
/Advanced Security must be enabled/,
|
||||
/Code Scanning is not enabled/
|
||||
].some((pattern) => pattern.test(msg));
|
||||
}
|
||||
function wrapApiConfigurationError(e) {
|
||||
const httpError = asHTTPError(e);
|
||||
if (httpError !== void 0) {
|
||||
@@ -80942,6 +80949,11 @@ function wrapApiConfigurationError(e) {
|
||||
"Please check that your token is valid and has the required permissions: contents: read, security-events: write"
|
||||
);
|
||||
}
|
||||
if (isEnablementError(httpError.message)) {
|
||||
return new ConfigurationError(
|
||||
`Please verify that the necessary features are enabled: ${httpError.message}`
|
||||
);
|
||||
}
|
||||
if (httpError.status === 429) {
|
||||
return new ConfigurationError("API rate limit exceeded");
|
||||
}
|
||||
|
||||
Generated
+12
@@ -79275,6 +79275,13 @@ async function getAnalysisKey() {
|
||||
core5.exportVariable(analysisKeyEnvVar, analysisKey);
|
||||
return analysisKey;
|
||||
}
|
||||
function isEnablementError(msg) {
|
||||
return [
|
||||
/Code Security must be enabled/,
|
||||
/Advanced Security must be enabled/,
|
||||
/Code Scanning is not enabled/
|
||||
].some((pattern) => pattern.test(msg));
|
||||
}
|
||||
function wrapApiConfigurationError(e) {
|
||||
const httpError = asHTTPError(e);
|
||||
if (httpError !== void 0) {
|
||||
@@ -79291,6 +79298,11 @@ function wrapApiConfigurationError(e) {
|
||||
"Please check that your token is valid and has the required permissions: contents: read, security-events: write"
|
||||
);
|
||||
}
|
||||
if (isEnablementError(httpError.message)) {
|
||||
return new ConfigurationError(
|
||||
`Please verify that the necessary features are enabled: ${httpError.message}`
|
||||
);
|
||||
}
|
||||
if (httpError.status === 429) {
|
||||
return new ConfigurationError("API rate limit exceeded");
|
||||
}
|
||||
|
||||
Generated
+12
@@ -82146,6 +82146,13 @@ function computeAutomationID(analysis_key, environment) {
|
||||
}
|
||||
return automationID;
|
||||
}
|
||||
function isEnablementError(msg) {
|
||||
return [
|
||||
/Code Security must be enabled/,
|
||||
/Advanced Security must be enabled/,
|
||||
/Code Scanning is not enabled/
|
||||
].some((pattern) => pattern.test(msg));
|
||||
}
|
||||
function wrapApiConfigurationError(e) {
|
||||
const httpError = asHTTPError(e);
|
||||
if (httpError !== void 0) {
|
||||
@@ -82162,6 +82169,11 @@ function wrapApiConfigurationError(e) {
|
||||
"Please check that your token is valid and has the required permissions: contents: read, security-events: write"
|
||||
);
|
||||
}
|
||||
if (isEnablementError(httpError.message)) {
|
||||
return new ConfigurationError(
|
||||
`Please verify that the necessary features are enabled: ${httpError.message}`
|
||||
);
|
||||
}
|
||||
if (httpError.status === 429) {
|
||||
return new ConfigurationError("API rate limit exceeded");
|
||||
}
|
||||
|
||||
Generated
+12
@@ -82191,6 +82191,13 @@ function computeAutomationID(analysis_key, environment) {
|
||||
}
|
||||
return automationID;
|
||||
}
|
||||
function isEnablementError(msg) {
|
||||
return [
|
||||
/Code Security must be enabled/,
|
||||
/Advanced Security must be enabled/,
|
||||
/Code Scanning is not enabled/
|
||||
].some((pattern) => pattern.test(msg));
|
||||
}
|
||||
function wrapApiConfigurationError(e) {
|
||||
const httpError = asHTTPError(e);
|
||||
if (httpError !== void 0) {
|
||||
@@ -82207,6 +82214,11 @@ function wrapApiConfigurationError(e) {
|
||||
"Please check that your token is valid and has the required permissions: contents: read, security-events: write"
|
||||
);
|
||||
}
|
||||
if (isEnablementError(httpError.message)) {
|
||||
return new ConfigurationError(
|
||||
`Please verify that the necessary features are enabled: ${httpError.message}`
|
||||
);
|
||||
}
|
||||
if (httpError.status === 429) {
|
||||
return new ConfigurationError("API rate limit exceeded");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user