mirror of
https://github.com/ditkrg/todo-to-issue-action.git
synced 2026-01-25 15:22:59 +00:00
feat: add Local client
This is just a safe fallback for local testing. If environment variables which activate the creation of the GitHub client aren't set, then the Local client is created. It acts on the most recent commit of the repo in the working directory. Minor edit to GitHubClient so that it raises an EnvironmentError exception if INPUT_GITHUB_URL environment variable is not defined. This allows main to detect the error and fall back to trying to use the Local client
This commit is contained in:
@@ -9,6 +9,8 @@ class GitHubClient(object):
|
||||
|
||||
def __init__(self):
|
||||
self.github_url = os.getenv('INPUT_GITHUB_URL')
|
||||
if not self.github_url:
|
||||
raise EnvironmentError
|
||||
self.base_url = f'{self.github_url}/'
|
||||
self.repos_url = f'{self.base_url}repos/'
|
||||
self.repo = os.getenv('INPUT_REPO')
|
||||
|
||||
Reference in New Issue
Block a user