@@ -52,14 +52,15 @@ def _write_github_output(github_output: Path, scope: str, task_scoped: bool) ->
5252
5353def _parse_args () -> argparse .Namespace :
5454 parser = argparse .ArgumentParser (
55- description = "Detect the PPC_TASKS value for CI from changed PR paths ." ,
55+ description = "Detect the PPC_TASKS value for CI." ,
5656 )
5757 parser .add_argument (
58- "--base-sha" , required = True , help = "Base commit for the PR diff."
59- )
60- parser .add_argument (
61- "--head-sha" , required = True , help = "Head commit for the PR diff."
58+ "--event-name" ,
59+ default = "pull_request" ,
60+ help = "GitHub event name. Non-PR events always run the full suite." ,
6261 )
62+ parser .add_argument ("--base-sha" , help = "Base commit for the PR diff." )
63+ parser .add_argument ("--head-sha" , help = "Head commit for the PR diff." )
6364 parser .add_argument (
6465 "--tasks-root" , default = "tasks" , type = Path , help = "Path to the tasks directory."
6566 )
@@ -73,9 +74,15 @@ def _parse_args() -> argparse.Namespace:
7374
7475def main () -> None :
7576 args = _parse_args ()
76- scope , task_scoped = detect_scope (
77- _changed_files (args .base_sha , args .head_sha ), args .tasks_root
78- )
77+ if args .event_name != "pull_request" :
78+ scope , task_scoped = FULL_SUITE , False
79+ else :
80+ if args .base_sha is None or args .head_sha is None :
81+ msg = "--base-sha and --head-sha are required for pull_request events"
82+ raise SystemExit (msg )
83+ scope , task_scoped = detect_scope (
84+ _changed_files (args .base_sha , args .head_sha ), args .tasks_root
85+ )
7986
8087 print (f"PPC_TASKS={ scope } " )
8188 if args .github_output is not None :
0 commit comments