FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Add "Requires authentication" to `wrapApiConfigurationError` by henrymercer · Pull Request #3450 · github/codeql-action · GitHub

Repository navigation

Add "Requires authentication" to wrapApiConfigurationError - #3450

Merged
henrymercer merged 1 commit into
mainfrom
henrymercer/add-requires-auth
Feb 2, 2026
Merged

henrymercer merged 1 commit into
mainfrom
henrymercer/add-requires-auth

Conversation

Copy link
Copy Markdown
Contributor

No description provided.

henrymercer requested a review from a team as a code owner February 2, 2026 18:02
Copilot AI review requested due to automatic review settings February 2, 2026 18:02
github-actions Bot added the size/XS Should be very easy to review label Feb 2, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Pull request overview

This PR enhances error handling in the CodeQL Action by adding "Requires authentication" to the list of recognized authentication error messages in the wrapApiConfigurationError function. This ensures that when the GitHub API returns a "Requires authentication" error, it is properly wrapped into a user-friendly ConfigurationError message that guides users to check their token validity and permissions.

Changes:

  • Added "Requires authentication" error message check to wrapApiConfigurationError function in src/api-client.ts
  • Updated generated JavaScript files in the lib directory to reflect the TypeScript changes

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/api-client.ts Added "Requires authentication" to the authentication error check condition, maintaining consistency with existing "Bad credentials" and "Not Found" checks
lib/upload-sarif-action.js Generated JavaScript - reflects the TypeScript source changes
lib/upload-lib.js Generated JavaScript - reflects the TypeScript source changes
lib/setup-codeql-action.js Generated JavaScript - reflects the TypeScript source changes
lib/init-action.js Generated JavaScript - reflects the TypeScript source changes
lib/init-action-post.js Generated JavaScript - reflects the TypeScript source changes
lib/analyze-action.js Generated JavaScript - reflects the TypeScript source changes

Comment thread src/api-client.ts
httpError.message.includes("Bad credentials") ||
httpError.message.includes("Not Found")
httpError.message.includes("Not Found") ||
httpError.message.includes("Requires authentication")

Copilot AI Feb 2, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

The new error message check for "Requires authentication" lacks test coverage. The existing test in src/api-client.test.ts (line 108) covers "Bad credentials" and "Not Found" cases but doesn't include a test case for "Requires authentication". Consider adding a test case similar to the existing ones to ensure this error is properly wrapped into a ConfigurationError with the token suggestion message.

Copilot uses AI. Check for mistakes.
henrymercer enabled auto-merge February 2, 2026 18:11
henrymercer merged commit ab5b0e3 into main Feb 2, 2026
256 checks passed
henrymercer deleted the henrymercer/add-requires-auth branch February 2, 2026 18:22
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/XS Should be very easy to review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants


Back | FazBrowse Home | New Git URL