Skip to content

Commit 871c774

Browse files
author
Mark Saroufim
committed
Fix PyGithub deprecation warning: use Auth.Token instead of login_or_token
Replace deprecated `Github(token)` with `Github(auth=Auth.Token(token))` to silence the DeprecationWarning from PyGithub.
1 parent cfb95f3 commit 871c774

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/libkernelbot/launchers/github.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
import github
1717
import requests
18-
from github import Github, UnknownObjectException
18+
from github import Auth, Github, UnknownObjectException
1919
from github.GithubObject import NotSet, Opt
2020
from github.Workflow import Workflow
2121
from github.WorkflowRun import WorkflowRun
@@ -240,7 +240,7 @@ def patched_create_dispatch(
240240

241241
class GitHubRun:
242242
def __init__(self, repo: str, token: str, branch: str, workflow_file: str):
243-
gh = Github(token)
243+
gh = Github(auth=Auth.Token(token))
244244
try:
245245
self.repo = gh.get_repo(repo)
246246
except UnknownObjectException as e:

0 commit comments

Comments
 (0)