Skip to content

Commit fb730dd

Browse files
committed
fix: deprecation warning from python pyGithub lib
1 parent 2dd14d3 commit fb730dd

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

main.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242

4343
# external
4444
from faker import Faker
45-
from github import ContentFile, Github, GithubException, InputGitAuthor, Repository
45+
from github import ContentFile, Github, GithubException, InputGitAuthor, Repository, Auth
4646
from requests import get as rq_get
4747
from requests.exceptions import RequestException
4848

@@ -463,7 +463,10 @@ class TargetRepository:
463463
def genesis():
464464
"""Run Program."""
465465
logger.debug("Connecting to GitHub")
466-
gh_connect = Github(wk_i.gh_token)
466+
# Create an Auth.Token object with your token
467+
auth = Auth.Token(wk_i.gh_token)
468+
# Pass the auth object to the Github constructor
469+
gh_connect = Github(auth=auth)
467470
# since a validator is being used earlier, casting
468471
# `wk_i.ENV_VARIABLE` to a string here, is okay
469472
gh_repo = gh_connect.get_repo(str(wk_i.repository))

0 commit comments

Comments
 (0)