-
Notifications
You must be signed in to change notification settings - Fork 5
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
Support reading GitHub token from env var #236
base: master
Are you sure you want to change the base?
Conversation
7e4b1fd
to
d5e72e4
Compare
I would like to share my config.yaml and update scripts in a git repo, so I need a way to supply the GitHub token outside of config.yaml This solution felt natural to me, but I would be willing to take a second pass utilizing a credentials file instead. Thanks for this great tool!
d5e72e4
to
299eb6c
Compare
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 for the contribution! If you can also add a test case for it in the /test
directory, that would be amazing 🙏 Something like mocking the env var APR_API_KEY
in the run_cli
util function and testing if the functionality still works afterwards would work
fdafee1
to
0726c8d
Compare
hey @daniddelrio, I copy+modified test_create_files to work as an e2e test for using the env var for the api key. It already had a mock for I had to adjust the feature implementation to play nice with pytest. Since the default value for the Click's CliRunner's env injection doesn't seem to inject the env var at the right time, so I used pytest's monkeypatch feature instead. Please let me know if you have any other feedback or suggestions :) |
0726c8d
to
a07c7ba
Compare
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.
LGTM, thanks again!
Proposed change
I would like to share my config.yaml and update scripts in a git repo, so I need a way to supply the GitHub token outside of config.yaml
This solution felt natural to me, but I would be willing to take a second pass utilizing a credentials file instead. (or any other preferred solution!)
Thanks for this great tool!
How to test the change
I tested manually by exporting the env var and successfully building a
db.json
withauto-pr pull
Checklist
CHANGELOG.md
has been updated to reflect changes