Skip to content

Add basic validation on credentials when instantiating clients#102

Open
nikola-jokic wants to merge 2 commits into
mainfrom
nikola-jokic/basic-validation-creds
Open

Add basic validation on credentials when instantiating clients#102
nikola-jokic wants to merge 2 commits into
mainfrom
nikola-jokic/basic-validation-creds

Conversation

@nikola-jokic
Copy link
Copy Markdown
Collaborator

Fixes #100

Copilot AI review requested due to automatic review settings May 19, 2026 13:45
@nikola-jokic nikola-jokic requested a review from a team as a code owner May 19, 2026 13:45
Copy link
Copy Markdown
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 addresses issue #100 by adding early credential validation when creating a scaleset client, preventing later panics when neither a GitHub App credential set nor a Personal Access Token (PAT) is provided.

Changes:

  • Added actionsAuth.validate() and enforced credential validation during newClient() construction.
  • Added unit tests for NewClientWithPersonalAccessToken and NewClientWithGitHubApp, including error cases for missing credentials.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
client.go Adds credential validation in actionsAuth and invokes it during client creation to fail fast on missing/invalid auth.
client_test.go Adds coverage for successful client construction and expected errors when credentials are missing/invalid.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread client.go Outdated
Comment thread client.go Outdated
@nikola-jokic nikola-jokic requested a review from Copilot May 19, 2026 14:35
Copy link
Copy Markdown
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

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Panic when PersonalAccessToken is empty string

2 participants