From 0254cbbcf8e29338f28b57a24657e727bbd08052 Mon Sep 17 00:00:00 2001 From: Johanna England Date: Wed, 24 Apr 2024 11:26:12 +0200 Subject: [PATCH] Update PyGithub version New way of authentication was introduced --- pyproject.toml | 2 +- src/argus_ticket_github.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index f71cbe0..30ed447 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -10,7 +10,7 @@ readme = "README.md" dependencies = [ "argus-server>=1.15", "markdownify>=0.11", - "PyGithub>=1.58", + "PyGithub>=1.59", "requests>=2.14", ] requires-python = ">=3.8" diff --git a/src/argus_ticket_github.py b/src/argus_ticket_github.py index b13c454..be8aeea 100644 --- a/src/argus_ticket_github.py +++ b/src/argus_ticket_github.py @@ -61,7 +61,7 @@ def get_labels( missing_fields = [] for field in labels_mapping: - if type(field) is dict: + if type(field).isinstance(dict): # Information can be found in tags label = incident_tags.get(field["tag"], None) if label: @@ -87,7 +87,7 @@ def create_client(endpoint, authentication): try: client = github.Github( - base_url=base_url, login_or_token=authentication["token"] + base_url=base_url, auth=github.Auth.Token(authentication["token"]) ) except Exception: client_error = "Github: Client could not be created."