Bugfix: PyGithub does not support explicit port in base_url (#2204)

* Bugfix: PyGithub does not support explicit port in base_url

* Fix unit tests

* Fix unit tests

* Added changelog

* Update changelogs/fragments/2204-github_repo-fix-baseurl_port.yml

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
This commit is contained in:
Álvaro Torres Cogollo 2021-04-09 06:00:21 +02:00 committed by GitHub
parent f0b7c6351e
commit 8eb2331aea
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 21 additions and 19 deletions

View file

@ -121,9 +121,9 @@ except Exception:
def authenticate(username=None, password=None, access_token=None):
if access_token:
return Github(base_url="https://api.github.com:443", login_or_token=access_token)
return Github(base_url="https://api.github.com", login_or_token=access_token)
else:
return Github(base_url="https://api.github.com:443", login_or_token=username, password=password)
return Github(base_url="https://api.github.com", login_or_token=username, password=password)
def create_repo(gh, name, organization=None, private=False, description='', check_mode=False):