From 769741e3bf790cbe2d27105445db6cf94b285f9d Mon Sep 17 00:00:00 2001 From: Kevin M Sampson <12707550+KevinMSampson@users.noreply.github.com> Date: Fri, 3 Feb 2023 14:59:00 -0600 Subject: [PATCH] Add GITHUB_URL to support GHES --- action.yml | 6 +++++- main.py | 5 +++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/action.yml b/action.yml index 0d34f25..37cb657 100644 --- a/action.yml +++ b/action.yml @@ -71,4 +71,8 @@ inputs: required: false IDENTIFIERS: description: 'Dictionary of custom identifiers' - required: false \ No newline at end of file + required: false + GITHUB_URL: + description: 'Base url of GitHub API' + required: false + default: ${{ github.api_url }} \ No newline at end of file diff --git a/main.py b/main.py index c6219c6..e3f6ced 100644 --- a/main.py +++ b/main.py @@ -43,10 +43,11 @@ class Issue(object): class GitHubClient(object): """Basic client for getting the last diff and creating/closing issues.""" existing_issues = [] - base_url = 'https://api.github.com/' - repos_url = f'{base_url}repos/' def __init__(self): + self.github_url = os.getenv('INPUT_GITHUB_URL') + self.base_url = f'{self.base_url}/' + self.repos_url = f'{self.base_url}repos/' self.repo = os.getenv('INPUT_REPO') self.before = os.getenv('INPUT_BEFORE') self.sha = os.getenv('INPUT_SHA')