mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-21 13:44:15 +08:00
[mergebot] Fix mergebot allow revert of codev diff (#91975)
mergebot was allowing non facebook-github-bot users to revert codev diffs when it shouldnt be allowed Fixes https://github.com/pytorch/test-infra/issues/1381 Pull Request resolved: https://github.com/pytorch/pytorch/pull/91975 Approved by: https://github.com/ZainRizvi, https://github.com/kit1980, https://github.com/malfet
This commit is contained in:
committed by
PyTorch MergeBot
parent
6b542147a3
commit
de4e4c785a
7
.github/scripts/trymerge.py
vendored
7
.github/scripts/trymerge.py
vendored
@ -1263,8 +1263,11 @@ def validate_revert(repo: GitRepo, pr: GitHubPR, *,
|
||||
commit_sha = commits[0]
|
||||
msg = repo.commit_message(commit_sha)
|
||||
rc = RE_DIFF_REV.search(msg)
|
||||
if rc is not None and not can_skip_internal_checks:
|
||||
raise PostCommentError(f"Can't revert PR that was landed via phabricator as {rc.group(1)}")
|
||||
if rc is not None and not skip_internal_checks:
|
||||
raise PostCommentError(
|
||||
f"Can't revert PR that was landed via phabricator as {rc.group(1)}. " +
|
||||
"Please revert by going to the internal diff and clicking Unland."
|
||||
)
|
||||
return (author_login, commit_sha)
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user