Skip to content

Commit bfa4a1b

Browse files
authored
Fix deprecated GitHub API authentication in airflow-github script (apache#56978)
Replace deprecated login_or_token parameter with Auth.Token() to eliminate deprecation warnings when running the airflow-github compare command. Updates all three Github() instantiations in compare, changelog, and needs_categorization functions to use the new auth parameter.
1 parent ded3172 commit bfa4a1b

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

dev/airflow-github

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ from typing import TYPE_CHECKING
3939

4040
import git
4141
import rich_click as click
42-
from github import Github
42+
from github import Auth, Github
4343
from packaging import version
4444
from rich.console import Console
4545
from rich.progress import Progress
@@ -309,7 +309,7 @@ def compare(target_version, github_token, previous_version=None, show_uncherrypi
309309

310310
repo = git.Repo(".", search_parent_directories=True)
311311

312-
github_handler = Github(github_token)
312+
github_handler = Github(auth=Auth.Token(github_token))
313313

314314
# Fetch PRs and Issues separately, with merged PRs identified upfront
315315
merged_prs: list[Issue] = list(
@@ -469,7 +469,7 @@ def changelog(previous_version, target_version, github_token, disable_progress_b
469469
if disable_progress_bar:
470470
print(f"Processing {len(log)} commits")
471471

472-
gh = Github(github_token)
472+
gh = Github(auth=Auth.Token(github_token))
473473
gh_repo = gh.get_repo("apache/airflow")
474474
sections = defaultdict(list)
475475
with open("RELEASE_NOTES.rst") as file:
@@ -509,7 +509,7 @@ def needs_categorization(previous_version, target_version, show_skipped, show_fi
509509
repo = git.Repo(".", search_parent_directories=True)
510510
log = get_commits_between(repo, previous_version, target_version)
511511

512-
gh = Github(github_token)
512+
gh = Github(auth=Auth.Token(github_token))
513513
gh_repo = gh.get_repo("apache/airflow")
514514
for commit in log:
515515
tickets = pr_title_re.findall(commit["subject"])

0 commit comments

Comments
 (0)