Skip to content

Conversation

@henrymercer
Copy link
Contributor

No description provided.

@henrymercer 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 github-actions bot added the size/XS Should be very easy to review label Feb 2, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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

httpError.message.includes("Bad credentials") ||
httpError.message.includes("Not Found")
httpError.message.includes("Not Found") ||
httpError.message.includes("Requires authentication")
Copy link

Copilot AI Feb 2, 2026

Choose a reason for hiding this comment

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

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 henrymercer enabled auto-merge February 2, 2026 18:11
@henrymercer henrymercer merged commit ab5b0e3 into main Feb 2, 2026
256 checks passed
@henrymercer henrymercer deleted the henrymercer/add-requires-auth branch February 2, 2026 18:22
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.

5 participants