@@ -59,9 +59,7 @@ def compute_changes() -> None:
5959 target_branch , head_branch = git_branches ()
6060 if target_branch and head_branch :
6161 # Getting changed files only makes sense on a pull request
62- files = get_changed_files (
63- f"origin/{ target_branch } " , f"origin/{ head_branch } "
64- )
62+ files = get_changed_files (target_branch , head_branch )
6563 outputs = process_changed_files (files )
6664 else :
6765 # Otherwise, just run the tests
@@ -90,14 +88,14 @@ def compute_changes() -> None:
9088
9189
9290def git_branches () -> tuple [str , str ]:
93- target_branch = os .environ .get ("GITHUB_BASE_REF " , "" )
94- target_branch = target_branch .removeprefix ("refs/heads/" )
95- print (f"target branch : { target_branch !r} " )
91+ target_ref = os .environ .get ("CCF_TARGET_REF " , "" )
92+ target_ref = target_ref .removeprefix ("refs/heads/" )
93+ print (f"target ref : { target_ref !r} " )
9694
97- head_branch = os .environ .get ("GITHUB_HEAD_REF " , "" )
98- head_branch = head_branch .removeprefix ("refs/heads/" )
99- print (f"head branch : { head_branch !r} " )
100- return target_branch , head_branch
95+ head_ref = os .environ .get ("CCF_HEAD_REF " , "" )
96+ head_ref = head_ref .removeprefix ("refs/heads/" )
97+ print (f"head ref : { head_ref !r} " )
98+ return f"origin/ { target_ref } " , head_ref
10199
102100
103101def get_changed_files (
@@ -109,6 +107,11 @@ def get_changed_files(
109107 changed_files_result = subprocess .run (
110108 args , stdout = subprocess .PIPE , check = True , encoding = "utf-8"
111109 )
110+ print ()
111+ print ()
112+ print (changed_files_result .stdout .strip ())
113+ print ()
114+ print ()
112115 changed_files = changed_files_result .stdout .strip ().splitlines ()
113116 return frozenset (map (Path , filter (None , map (str .strip , changed_files ))))
114117
0 commit comments