feat: add multi-token support for fine-grained PATs #11
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
Add
REVIEW_ROADMAP_GITHUB_TOKENSenvironment variable that accepts a comma-separated list of GitHub tokens. When--postis used, each token is tested for write access until one with the correct permissions is found.This is useful when working with multiple repositories that each have their own fine-grained PAT, eliminating the need to change
.envwhen switching between projects.Changes
REVIEW_ROADMAP_GITHUB_TOKENSsetting with helper methods (get_github_tokens(),get_default_github_token())find_working_token()function to search through tokens for write access--postflag is providedUsage
# In .env - list multiple fine-grained PATs REVIEW_ROADMAP_GITHUB_TOKENS=ghp_token_for_repo1,ghp_token_for_repo2,ghp_token_for_repo3When running with
--post, tokens are tried in order until one with write access is found:Precedence
REVIEW_ROADMAP_GITHUB_TOKENStakes precedence overGITHUB_TOKENfor write operationsGITHUB_TOKENis appended as a fallback if not already in the listTest Results
All 89 tests pass with 84% coverage.