Skip to content
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

[Chore] Provide token when getting 401 error #88

Merged
merged 1 commit into from
Sep 22, 2022

Conversation

ohenak
Copy link

@ohenak ohenak commented Sep 22, 2022

Issue #87

In GHE, token is necessary when querying the repo API, When it fails, it returns 401 error. Will need to specify the token in this case.

Before the fix:

pull-request-action on ξ‚  fix/ghe-get-401-error [!] via 🐍 v2.7.18 via πŸ’Ž v2.7.0
❯ python3 pull-request.py
==========================================================================
START: Running Pull Request on Branch Update Action!
Found ${GITHUB_EVENT_PATH} at /Users/hokho/workspace/pull-request-action
Branch prefix is
No branch prefix is set, all branches will be used.
Unable to retrieve default branch: 401: Unauthorized
 {'message': 'Must authenticate to access this API.', 'documentation_url': 'https://docs.github.com/enterprise/3.3/rest'}

After the fix:

pull-request-action on ξ‚  fix/ghe-get-401-error [!] via 🐍 v2.7.18 via πŸ’Ž v2.7.0
❯ python3 pull-request.py
==========================================================================
START: Running Pull Request on Branch Update Action!
Found ${GITHUB_EVENT_PATH} at /Users/hokho/workspace/pull-request-action
Branch prefix is
No branch prefix is set, all branches will be used.
Found default branch: develop
Pull requests will go to develop

Issue vsoch#87

In GHE, token is necessary when querying the repo API,
When it fails, it returns 401 error. Will need to specify the token in
this case.
@vsoch
Copy link
Owner

vsoch commented Sep 22, 2022

Thank you! Would you mind using your branch for your PR and showing (link here or screenshot) that it fixes the issue? I'm off to bed but will be back later after the next work day. Thanks for opening the PR! πŸ₯³

@ohenak
Copy link
Author

ohenak commented Sep 22, 2022

Thank you! Would you mind using your branch for your PR and showing (link here or screenshot) that it fixes the issue? I'm off to bed but will be back later after the next work day. Thanks for opening the PR! πŸ₯³

Updated the description. Let me know if that works. I just run it in the console manually.

@vsoch vsoch merged commit 4155448 into vsoch:master Sep 22, 2022
@ohenak ohenak deleted the fix/ghe-get-401-error branch September 22, 2022 15:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants