From e68005965e9f129bf8155595076c9d2df02e2c7c Mon Sep 17 00:00:00 2001 From: "Aivin V. Solatorio" Date: Thu, 2 Apr 2026 01:07:15 -0400 Subject: [PATCH] fix: workflow_dispatch full sync; use Auth.Token to avoid deprecation --- scripts/sync_github_issues.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/scripts/sync_github_issues.py b/scripts/sync_github_issues.py index bfa1011..8ae52ed 100644 --- a/scripts/sync_github_issues.py +++ b/scripts/sync_github_issues.py @@ -7,10 +7,11 @@ import subprocess import yaml from pathlib import Path -from github import Github +from github import Auth, Github REPO_SLUG = os.environ["GITHUB_REPOSITORY"] TOKEN = os.environ["GITHUB_TOKEN"] +EVENT_NAME = os.environ.get("GITHUB_EVENT_NAME", "") STATUS_LABELS = { "pending": "status:pending", @@ -122,7 +123,7 @@ def get_changed_task_files(todo_dir: Path) -> list[Path] | None: def main(): - g = Github(TOKEN) + g = Github(auth=Auth.Token(TOKEN)) repo = g.get_repo(REPO_SLUG) todo_dir = Path("TODO") @@ -130,7 +131,11 @@ def main(): print("No TODO directory found.") return - changed = get_changed_task_files(todo_dir) + # workflow_dispatch has no meaningful HEAD~1 diff — always do full sync + if EVENT_NAME == "workflow_dispatch": + changed = None + else: + changed = get_changed_task_files(todo_dir) if changed is None: task_files = [f for f in todo_dir.glob("*.md") if f.name not in SKIP_FILES]