-
Notifications
You must be signed in to change notification settings - Fork 26
Adds support for providing a GitHub token via envvar #75
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
danobi
merged 5 commits into
danobi:master
from
mattfield:support-resolving-token-from-envvar
Jun 12, 2025
Merged
Adds support for providing a GitHub token via envvar #75
danobi
merged 5 commits into
danobi:master
from
mattfield:support-resolving-token-from-envvar
Jun 12, 2025
Conversation
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
Owner
|
Thanks for the PR! Acknowledging that I see it - I will review in the morning |
danobi
reviewed
Jun 10, 2025
- `token` field no longer accepts custom envvar names and we now only search for known GitHub envvars. If a located envvar is empty, we now return an error rather than continuing to search - `resolve_github_token` refactored with a generic closure parameter for envvar lookups. Eliminates test race conditions with a custom lookup function rather than setting/wiping the environment each time, removing the need for tests to run sequentially - Tidied up tests to remove old `resolve_github_token` implementation, and added new tests to cover token precedence, empty config fallback, etc - Deduplicated docs in `config.md` in favour of linking, and clarified error message when GitHub token cannot be located
Contributor
Author
|
@danobi Many thanks for the review! Feedback has been implemented and PR updated. Specifics are in the commit message. |
danobi
reviewed
Jun 11, 2025
danobi
approved these changes
Jun 12, 2025
Owner
danobi
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks a bunch!
Contributor
Author
|
@danobi Pleasure! |
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.
Adds support for providing a GitHub token via an environment variable:
tokenthat begins with$, treat it as an envvar and perform a lookuptokenthen look forGH_TOKEN,GITHUB_TOKEN,GH_ENTERPRISE_TOKEN, orGITHUB_ENTERPRISE_TOKEN, in that order, and use the first token found.I've also added a whole bunch of tests for as many scenarios/permutations of this that I can think of, as well as added
serial_testas a dev dependency so the envvar tests run sequentially to avoid envvar definitions/removals clobbering each other. Please let me know if I've missed anything!Closes #61