Closed ohenak closed 2 years ago
We are on Github Enterprise 3.3, when the find_default_branch is invoked, It gets the following error:
find_default_branch
Unable to retrieve default branch: 401: Unauthorized [26](https://github.braintreeps.com/venmo/mobile-release-ios/runs/6575890?check_suite_focus=true#step:5:26) {'message': 'Must authenticate to access this API.', 'documentation_url': 'https://docs.github.com/enterprise/3.3/rest'}
It is because the initial Get request does not incorporate the token. https://github.com/vsoch/pull-request-action/blob/master/pull-request.py#L239-L243
Get
response = requests.get(REPO_URL) # Case 1: 404 might need a token if response.status_code == 404: response = requests.get(REPO_URL, headers=HEADERS)
Do you prefer handling 404 and 401 in the if statement? Or always include the headers from the first Get request?
Ah we can add that! Would you care to PR and bump the version?
Fixed by #88. Thank you!
We are on Github Enterprise 3.3, when the
find_default_branch
is invoked, It gets the following error:It is because the initial
Get
request does not incorporate the token. https://github.com/vsoch/pull-request-action/blob/master/pull-request.py#L239-L243