Skip to content

Commit 8dc4d81

Browse files
committed
Ignore binary files for push_log_to_gh
1 parent 083bca7 commit 8dc4d81

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

scripts/push_log_to_gh.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
import subprocess
99
from pathlib import Path
1010

11+
from unidiff import PatchSet
12+
1113

1214
def main(cc_folder: Path):
1315
folder_contents = [f.name for f in list(cc_folder.iterdir())]
@@ -59,8 +61,11 @@ def main(cc_folder: Path):
5961
continue
6062
with open(changes_file) as f:
6163
changes = json.load(f)
64+
patch = PatchSet(changes["incremental_diff"])
65+
# Remove any binary files from the patch
66+
patch = PatchSet("\n".join([str(file) for file in patch if "Binary files" not in str(file)]))
6267
with open("temp.diff", "w") as f:
63-
f.write(changes["incremental_diff"])
68+
f.write(str(patch))
6469

6570
apply_cmd = "git apply ../temp.diff"
6671
if arena == "BattleSnake":

0 commit comments

Comments
 (0)