feat(provider): add GitHub token support for API authentication#1
Merged
feat(provider): add GitHub token support for API authentication#1
Conversation
Add optional github_token provider attribute and GITHUB_TOKEN environment variable support to authenticate GitHub API requests with Bearer token. This allows higher rate limits when resolving GitHub usernames to user IDs.
There was a problem hiding this comment.
Pull request overview
This PR adds optional GitHub personal access token support to the CodeRabbit Terraform provider to enable authenticated GitHub API requests with higher rate limits.
Key changes:
- Added
github_tokenprovider configuration attribute with support forGITHUB_TOKENenvironment variable - Modified client to include Authorization header with Bearer token in GitHub API requests
- Updated documentation in README.md and CLAUDE.md
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| internal/provider/provider.go | Added github_token schema attribute and configuration logic following existing patterns for API key and base URL |
| internal/client/client.go | Extended Client struct and NewClient function to accept and use GitHub token in Authorization header for API requests |
| README.md | Added documentation for new github_token configuration option and GITHUB_TOKEN environment variable |
| CLAUDE.md | Added reminder to update README.md when modifying provider behavior |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
github_tokenprovider attribute for GitHub API authenticationGITHUB_TOKENenvironment variable as an alternative configuration methodTest plan
make buildgithub_tokenattribute and verify GitHub API requests include Authorization headerGITHUB_TOKENenvironment variable and verify it works without explicit provider config