-
Notifications
You must be signed in to change notification settings - Fork 16
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
fix: use GitHub App token when authed with GitHub App #103
Merged
jmeridth
merged 5 commits into
main
from
jm-use-app-token-in-graphql-when-using-github-app
Apr 26, 2024
Merged
fix: use GitHub App token when authed with GitHub App #103
jmeridth
merged 5 commits into
main
from
jm-use-app-token-in-graphql-when-using-github-app
Apr 26, 2024
Conversation
This file contains 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
Still testing this |
jmeridth
force-pushed
the
jm-use-app-token-in-graphql-when-using-github-app
branch
from
April 26, 2024 14:25
66717f0
to
0297d19
Compare
Fixes #98 Currently we are still trying to use the GH_TOKEN env var when making graphql calls even after authing with a GitHub App Installation. This change fixes that. Alsof fixed a few other things while in here: - [x] add all missing env var options to .env-example - [x] ensure .env file contents are not used in env var tests - [x] alphabetize things, as they should be - [x] add test for github auth change token usage Signed-off-by: jmeridth <[email protected]>
jmeridth
force-pushed
the
jm-use-app-token-in-graphql-when-using-github-app
branch
from
April 26, 2024 14:26
0297d19
to
9205dd0
Compare
jmeridth
commented
Apr 26, 2024
@@ -42,6 +42,11 @@ def main(): # pragma: no cover | |||
token, gh_app_id, gh_app_installation_id, gh_app_private_key, ghe | |||
) | |||
|
|||
if not token and gh_app_id and gh_app_installation_id and gh_app_private_key: |
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.
core change of this PR
jmeridth
commented
Apr 26, 2024
str: the GitHub App token | ||
""" | ||
jwt_headers = github3.apps.create_jwt_headers(gh_app_private_key_bytes, gh_app_id) | ||
url = f"https://api.github.com/app/installations/{gh_app_installation_id}/access_tokens" |
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.
core change of this PR
zkoppert
reviewed
Apr 26, 2024
zkoppert
reviewed
Apr 26, 2024
Co-authored-by: Zack Koppert <[email protected]>
Co-authored-by: Zack Koppert <[email protected]>
zkoppert
reviewed
Apr 26, 2024
Co-authored-by: Zack Koppert <[email protected]>
jmeridth
commented
Apr 26, 2024
Change from 20 seconds to 5
zkoppert
approved these changes
Apr 26, 2024
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.
Fixes #98
Pull Request
Proposed Changes
Currently we are still trying to use the GH_TOKEN env var when making graphql calls even after authenticating with a GitHub App Installation. This change fixes that.
Also fixed a few other things while in here:
Readiness Checklist
Author/Contributor
make lint
and fix any issues that you have introducedmake test
and ensure you have test coverage for the lines you are introducingReviewer
bug
,documentation
,enhancement
,infrastructure
,maintenance
orbreaking