Fix deprecated GitHub API authentication in airflow-github script (#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.
This commit is contained in:
Kaxil Naik authored and GitHub committed 2025-10-21 21:23:14 +01:00
1 parent ded31721d0
commit bfa4a1bb50
1 file changed
+4 -4
+4 -4
View File
@@ -39,7 +39,7 @@ from typing import TYPE_CHECKING
import git
import rich_click as click
from github import Github
from github import Auth, Github
from packaging import version
from rich.console import Console
from rich.progress import Progress
@@ -309,7 +309,7 @@ def compare(target_version, github_token, previous_version=None, show_uncherrypi
repo = git.Repo(".", search_parent_directories=True)
github_handler = Github(github_token)
github_handler = Github(auth=Auth.Token(github_token))
# Fetch PRs and Issues separately, with merged PRs identified upfront
merged_prs: list[Issue] = list(
@@ -469,7 +469,7 @@ def changelog(previous_version, target_version, github_token, disable_progress_b
if disable_progress_bar:
print(f"Processing {len(log)} commits")
gh = Github(github_token)
gh = Github(auth=Auth.Token(github_token))
gh_repo = gh.get_repo("apache/airflow")
sections = defaultdict(list)
with open("RELEASE_NOTES.rst") as file:
@@ -509,7 +509,7 @@ def needs_categorization(previous_version, target_version, show_skipped, show_fi
repo = git.Repo(".", search_parent_directories=True)
log = get_commits_between(repo, previous_version, target_version)
gh = Github(github_token)
gh = Github(auth=Auth.Token(github_token))
gh_repo = gh.get_repo("apache/airflow")
for commit in log:
tickets = pr_title_re.findall(commit["subject"])