Skip to content

[Chore] Provide token when getting 401 error#88

Merged
vsoch merged 1 commit intovsoch:masterfrom
ohenak:fix/ghe-get-401-error
Sep 22, 2022
Merged

[Chore] Provide token when getting 401 error#88
vsoch merged 1 commit intovsoch:masterfrom
ohenak:fix/ghe-get-401-error

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.

2 participants