Adding quick option to be able to specify a GitHub enterprise url (#80)

* adding quick option to be able to specify a GitHub enterprise url
Signed-off-by: vsoch <vsoch@users.noreply.github.com>
* Use GITHUB_API_URL instead
Co-authored-by: Tobias <github@tobiasgabriel.de>

* Update README.md
* Update pull-request.py

Co-authored-by: vsoch <vsoch@users.noreply.github.com>
Co-authored-by: Tobias <github@tobiasgabriel.de>
This commit is contained in:
Vanessasaurus
2021-10-02 22:40:48 -06:00
committed by GitHub
parent a48b660567
commit d99aa3ed71
2 changed files with 8 additions and 7 deletions

View File

@@ -235,8 +235,7 @@ def find_pull_request(listing, source):
def find_default_branch():
"""Find default branch for a repo (only called if branch not provided)
"""
"""Find default branch for a repo (only called if branch not provided)"""
response = requests.get(REPO_URL)
# Case 1: 404 might need a token
@@ -283,7 +282,9 @@ def add_reviewers(entry, reviewers, team_reviewers):
################################################################################
API_VERSION = "v3"
BASE = "https://api.github.com"
# Allow for a GitHub enterprise URL
BASE = os.environ.get("GITHUB_API_URL") or "https://api.github.com"
PR_TOKEN = os.environ.get("PULL_REQUEST_TOKEN") or get_envar("GITHUB_TOKEN")
PR_REPO = os.environ.get("PULL_REQUEST_REPOSITORY") or get_envar("GITHUB_REPOSITORY")