Skip to content

Commit 7a81434

Browse files
fabiobaltierikartben
authored andcommitted
scripts: update the Github auth API
Fixes: /home/runner/work/zephyr/zephyr/scripts/ci/do_not_merge.py:66: DeprecationWarning: Argument login_or_token is deprecated, please use auth=github.Auth.Token(...) instead Signed-off-by: Fabio Baltieri <[email protected]>
1 parent 0d0e261 commit 7a81434

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

scripts/ci/check_maintainer_changes.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
import sys
99

1010
import yaml
11-
from github import Github
11+
from github import Auth, Github
1212

1313

1414
def load_areas(filename: str):
@@ -25,7 +25,7 @@ def set_or_empty(d, key):
2525

2626
def check_github_access(usernames, repo_fullname, token):
2727
"""Check if each username has at least Triage access to the repo."""
28-
gh = Github(token)
28+
gh = Github(auth=Auth.Token(token))
2929
repo = gh.get_repo(repo_fullname)
3030
missing_access = set()
3131
for username in usernames:

scripts/ci/do_not_merge.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,8 @@ def workflow_delay(repo, pr):
6262
def main(argv):
6363
args = parse_args(argv)
6464

65-
token = os.environ.get('GITHUB_TOKEN', None)
66-
gh = github.Github(token)
65+
auth = github.Auth.Token(os.environ.get('GITHUB_TOKEN', None))
66+
gh = github.Github(auth=auth)
6767

6868
print_rate_limit(gh, args.org)
6969

scripts/ci/stats/merged_prs.py

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

99
import sys
1010
import os
11-
from github import Github
11+
from github import Auth, Github
1212
import argparse
1313
from elasticsearch import Elasticsearch
1414
from elasticsearch.helpers import bulk
@@ -137,7 +137,7 @@ def main():
137137
sys.exit('Github token not set in environment, please set the '
138138
'GITHUB_TOKEN environment variable and retry.')
139139

140-
gh = Github(token)
140+
gh = Github(auth=Auth.Token(token))
141141
json_list = []
142142
gh_repo = gh.get_repo(args.repo)
143143

scripts/set_assignees.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
import time
1111
from collections import defaultdict
1212

13-
from github import Github, GithubException
13+
from github import Auth, Github, GithubException
1414
from github.GithubException import UnknownObjectException
1515
from west.manifest import Manifest, ManifestProject
1616

@@ -443,7 +443,7 @@ def main():
443443
'GITHUB_TOKEN environment variable and retry.'
444444
)
445445

446-
gh = Github(token)
446+
gh = Github(auth=Auth.Token(token))
447447
maintainer_file = Maintainers(args.maintainer_file)
448448

449449
if args.pull_request:

0 commit comments

Comments
 (0)