Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import sys
import subprocess
import re
from github import Github # type: ignore
from github import Github, Auth # type: ignore


# Constants for message titles
Expand Down Expand Up @@ -124,7 +124,10 @@ def add_pr_comments() -> int:
raise ValueError("GITHUB_REF environment variable is not set")

# Initialize GitHub client
g = Github(token)
# Use new Auth API to avoid deprecation warning
if not token:
raise ValueError("GITHUB_TOKEN is not set")
g = Github(auth=Auth.Token(token))
repo = g.get_repo(repo_name)
pull_request = repo.get_issue(int(pr_number))

Expand Down
Loading