From 52a7bd7b6e714abd930eb15cde3c7c76c45d6c0f Mon Sep 17 00:00:00 2001 From: "Michael B. Gale" Date: Wed, 29 Oct 2025 08:35:19 +0000 Subject: [PATCH] Check for 403 status --- lib/analyze-action.js | 2 +- lib/init-action-post.js | 2 +- lib/init-action.js | 2 +- lib/setup-codeql-action.js | 2 +- lib/upload-lib.js | 2 +- lib/upload-sarif-action.js | 2 +- src/api-client.ts | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/analyze-action.js b/lib/analyze-action.js index 253ef2c9b..9515b2a43 100644 --- a/lib/analyze-action.js +++ b/lib/analyze-action.js @@ -83647,7 +83647,7 @@ function wrapApiConfigurationError(e) { "Please check that your token is valid and has the required permissions: contents: read, security-events: write" ); } - if (isEnablementError(httpError.message)) { + if (httpError.status === 403 && isEnablementError(httpError.message)) { return new ConfigurationError( getFeatureEnablementError(httpError.message) ); diff --git a/lib/init-action-post.js b/lib/init-action-post.js index 1f56d4943..69e6230d2 100644 --- a/lib/init-action-post.js +++ b/lib/init-action-post.js @@ -116784,7 +116784,7 @@ function wrapApiConfigurationError(e) { "Please check that your token is valid and has the required permissions: contents: read, security-events: write" ); } - if (isEnablementError(httpError.message)) { + if (httpError.status === 403 && isEnablementError(httpError.message)) { return new ConfigurationError( getFeatureEnablementError(httpError.message) ); diff --git a/lib/init-action.js b/lib/init-action.js index 3c63f5a42..c976f2e30 100644 --- a/lib/init-action.js +++ b/lib/init-action.js @@ -80952,7 +80952,7 @@ function wrapApiConfigurationError(e) { "Please check that your token is valid and has the required permissions: contents: read, security-events: write" ); } - if (isEnablementError(httpError.message)) { + if (httpError.status === 403 && isEnablementError(httpError.message)) { return new ConfigurationError( getFeatureEnablementError(httpError.message) ); diff --git a/lib/setup-codeql-action.js b/lib/setup-codeql-action.js index 5b8888d45..327dcfcb8 100644 --- a/lib/setup-codeql-action.js +++ b/lib/setup-codeql-action.js @@ -79301,7 +79301,7 @@ function wrapApiConfigurationError(e) { "Please check that your token is valid and has the required permissions: contents: read, security-events: write" ); } - if (isEnablementError(httpError.message)) { + if (httpError.status === 403 && isEnablementError(httpError.message)) { return new ConfigurationError( getFeatureEnablementError(httpError.message) ); diff --git a/lib/upload-lib.js b/lib/upload-lib.js index d220cda56..bc3545aa6 100644 --- a/lib/upload-lib.js +++ b/lib/upload-lib.js @@ -82172,7 +82172,7 @@ function wrapApiConfigurationError(e) { "Please check that your token is valid and has the required permissions: contents: read, security-events: write" ); } - if (isEnablementError(httpError.message)) { + if (httpError.status === 403 && isEnablementError(httpError.message)) { return new ConfigurationError( getFeatureEnablementError(httpError.message) ); diff --git a/lib/upload-sarif-action.js b/lib/upload-sarif-action.js index 1a981457f..ed785239d 100644 --- a/lib/upload-sarif-action.js +++ b/lib/upload-sarif-action.js @@ -82217,7 +82217,7 @@ function wrapApiConfigurationError(e) { "Please check that your token is valid and has the required permissions: contents: read, security-events: write" ); } - if (isEnablementError(httpError.message)) { + if (httpError.status === 403 && isEnablementError(httpError.message)) { return new ConfigurationError( getFeatureEnablementError(httpError.message) ); diff --git a/src/api-client.ts b/src/api-client.ts index 8b730e4ed..f271c2791 100644 --- a/src/api-client.ts +++ b/src/api-client.ts @@ -318,7 +318,7 @@ export function wrapApiConfigurationError(e: unknown) { "Please check that your token is valid and has the required permissions: contents: read, security-events: write", ); } - if (isEnablementError(httpError.message)) { + if (httpError.status === 403 && isEnablementError(httpError.message)) { return new ConfigurationError( getFeatureEnablementError(httpError.message), );