mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 21:14:14 +08:00
[ez][CI] Do not reuse old whl if deleting files (#154731)
Thankfully very few commits actually delete files so I don't think has affected anything Pull Request resolved: https://github.com/pytorch/pytorch/pull/154731 Approved by: https://github.com/Skylion007
This commit is contained in:
committed by
PyTorch MergeBot
parent
eb93c0adb1
commit
0f3db20132
17
.github/actions/reuse-old-whl/reuse_old_whl.py
vendored
17
.github/actions/reuse-old-whl/reuse_old_whl.py
vendored
@ -120,6 +120,23 @@ def ok_changed_file(file: str) -> bool:
|
||||
def check_changed_files(sha: str) -> bool:
|
||||
# Return true if all the changed files are in the list of allowed files to
|
||||
# be changed to reuse the old whl
|
||||
|
||||
# Removing any files is not allowed since rysnc will not remove files
|
||||
removed_files = (
|
||||
subprocess.check_output(
|
||||
["git", "diff", "--name-only", sha, "HEAD", "--diff-filter=D"],
|
||||
text=True,
|
||||
stderr=subprocess.DEVNULL,
|
||||
)
|
||||
.strip()
|
||||
.split()
|
||||
)
|
||||
if removed_files:
|
||||
print(
|
||||
f"Removed files between {sha} and HEAD: {removed_files}, cannot reuse old whl"
|
||||
)
|
||||
return False
|
||||
|
||||
changed_files = (
|
||||
subprocess.check_output(
|
||||
["git", "diff", "--name-only", sha, "HEAD"],
|
||||
|
Reference in New Issue
Block a user