From bf4cb2c12ad9fb71233c5ed60ec4cd717f6302de Mon Sep 17 00:00:00 2001 From: Joe Banks Date: Wed, 16 Jul 2025 10:08:40 +0100 Subject: Move common variables for GitHub API into common file --- arthur/apis/github/common.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 arthur/apis/github/common.py (limited to 'arthur/apis/github/common.py') diff --git a/arthur/apis/github/common.py b/arthur/apis/github/common.py new file mode 100644 index 0000000..5ac4676 --- /dev/null +++ b/arthur/apis/github/common.py @@ -0,0 +1,18 @@ +from arthur.config import CONFIG + + +class GitHubError(Exception): + """Custom exception for GitHub API errors.""" + + def __init__(self, message: str): + super().__init__(message) + + +HEADERS = { + "Accept": "application/vnd.github+json", + "X-GitHub-Api-Version": "2022-11-28", + "Authorization": f"Bearer {CONFIG.github_token.get_secret_value()}", +} +HTTP_404 = 404 +HTTP_403 = 403 +HTTP_422 = 422 -- cgit v1.2.3