diff --git a/lib/analyze-action.js b/lib/analyze-action.js index 46e6c1d291..10b796278a 100644 --- a/lib/analyze-action.js +++ b/lib/analyze-action.js @@ -105282,7 +105282,7 @@ function wrapApiConfigurationError(e) { ].some((pattern) => pattern.test(httpError.message))) { return new ConfigurationError(httpError.message); } - if (httpError.message.includes("Bad credentials") || httpError.message.includes("Not Found")) { + if (httpError.message.includes("Bad credentials") || httpError.message.includes("Not Found") || httpError.message.includes("Requires authentication")) { return new ConfigurationError( "Please check that your token is valid and has the required permissions: contents: read, security-events: write" ); diff --git a/lib/init-action-post.js b/lib/init-action-post.js index 3644b89314..6d71adc593 100644 --- a/lib/init-action-post.js +++ b/lib/init-action-post.js @@ -146015,7 +146015,7 @@ function wrapApiConfigurationError(e) { ].some((pattern) => pattern.test(httpError.message))) { return new ConfigurationError(httpError.message); } - if (httpError.message.includes("Bad credentials") || httpError.message.includes("Not Found")) { + if (httpError.message.includes("Bad credentials") || httpError.message.includes("Not Found") || httpError.message.includes("Requires authentication")) { return new ConfigurationError( "Please check that your token is valid and has the required permissions: contents: read, security-events: write" ); diff --git a/lib/init-action.js b/lib/init-action.js index c3387b687e..a90cc55655 100644 --- a/lib/init-action.js +++ b/lib/init-action.js @@ -102618,7 +102618,7 @@ function wrapApiConfigurationError(e) { ].some((pattern) => pattern.test(httpError.message))) { return new ConfigurationError(httpError.message); } - if (httpError.message.includes("Bad credentials") || httpError.message.includes("Not Found")) { + if (httpError.message.includes("Bad credentials") || httpError.message.includes("Not Found") || httpError.message.includes("Requires authentication")) { return new ConfigurationError( "Please check that your token is valid and has the required permissions: contents: read, security-events: write" ); diff --git a/lib/setup-codeql-action.js b/lib/setup-codeql-action.js index 502a20d6c7..59af2bf5cc 100644 --- a/lib/setup-codeql-action.js +++ b/lib/setup-codeql-action.js @@ -102021,7 +102021,7 @@ function wrapApiConfigurationError(e) { ].some((pattern) => pattern.test(httpError.message))) { return new ConfigurationError(httpError.message); } - if (httpError.message.includes("Bad credentials") || httpError.message.includes("Not Found")) { + if (httpError.message.includes("Bad credentials") || httpError.message.includes("Not Found") || httpError.message.includes("Requires authentication")) { return new ConfigurationError( "Please check that your token is valid and has the required permissions: contents: read, security-events: write" ); diff --git a/lib/upload-lib.js b/lib/upload-lib.js index 4b3bda3aa5..4917e2df6c 100644 --- a/lib/upload-lib.js +++ b/lib/upload-lib.js @@ -104895,7 +104895,7 @@ function wrapApiConfigurationError(e) { ].some((pattern) => pattern.test(httpError.message))) { return new ConfigurationError(httpError.message); } - if (httpError.message.includes("Bad credentials") || httpError.message.includes("Not Found")) { + if (httpError.message.includes("Bad credentials") || httpError.message.includes("Not Found") || httpError.message.includes("Requires authentication")) { return new ConfigurationError( "Please check that your token is valid and has the required permissions: contents: read, security-events: write" ); diff --git a/lib/upload-sarif-action.js b/lib/upload-sarif-action.js index cb154f5dda..852442e176 100644 --- a/lib/upload-sarif-action.js +++ b/lib/upload-sarif-action.js @@ -104941,7 +104941,7 @@ function wrapApiConfigurationError(e) { ].some((pattern) => pattern.test(httpError.message))) { return new ConfigurationError(httpError.message); } - if (httpError.message.includes("Bad credentials") || httpError.message.includes("Not Found")) { + if (httpError.message.includes("Bad credentials") || httpError.message.includes("Not Found") || httpError.message.includes("Requires authentication")) { return new ConfigurationError( "Please check that your token is valid and has the required permissions: contents: read, security-events: write" ); diff --git a/src/api-client.ts b/src/api-client.ts index 592c113b33..f2fe01edf0 100644 --- a/src/api-client.ts +++ b/src/api-client.ts @@ -306,7 +306,8 @@ export function wrapApiConfigurationError(e: unknown) { } if ( httpError.message.includes("Bad credentials") || - httpError.message.includes("Not Found") + httpError.message.includes("Not Found") || + httpError.message.includes("Requires authentication") ) { return new ConfigurationError( "Please check that your token is valid and has the required permissions: contents: read, security-events: write",