Skip to content

Commit 2da12a4

Browse files
committed
fix(pygithub): use Auth.Token API for newer PyGithub versions
The deprecated positional login_or_token argument no longer authenticates in recent PyGithub releases; switch to the explicit Auth.Token form. Signed-off-by: yuanyuyuan <az6980522@gmail.com>
1 parent e4ae152 commit 2da12a4

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

ros_github_scripts/ci_for_pr.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
from typing import Optional
2222

2323
import github
24-
from github import Github, InputFileContent
24+
from github import Auth, Github, InputFileContent
2525
import requests
2626
import yaml
2727

@@ -411,7 +411,7 @@ def main():
411411
github_access_token = os.environ.get('GITHUB_TOKEN')
412412
if not github_access_token:
413413
panic('Neither environment variable GITHUB_ACCESS_TOKEN nor GITHUB_TOKEN are set')
414-
github_instance = Github(github_access_token)
414+
github_instance = Github(auth=Auth.Token(github_access_token))
415415

416416
branch_name = parsed.branch
417417
pull_texts = parsed.pulls

0 commit comments

Comments
 (0)