Skip to content

Commit 1e6ad64

Browse files
committed
Do not process closed PRs
1 parent ee9e61d commit 1e6ad64

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

Diff for: process_pr.py

+8
Original file line numberDiff line numberDiff line change
@@ -1019,6 +1019,7 @@ def process_pr(repo_config, gh, repo, issue, dryRun, cmsbuild_user=None, force=F
10191019
ok_too_many_files = False
10201020
warned_too_many_files = False
10211021
is_draft_pr = False
1022+
pr = None
10221023

10231024
if issue.pull_request:
10241025
pr = repo.get_pull(prId)
@@ -1043,6 +1044,9 @@ def process_pr(repo_config, gh, repo, issue, dryRun, cmsbuild_user=None, force=F
10431044
)
10441045
issue.create_comment(msg)
10451046
return
1047+
if pr.merged and (not force):
1048+
logger.error("This PR is merged, quitting")
1049+
return
10461050
# A pull request is by default closed if the branch is a closed one.
10471051
if is_closed_branch(pr.base.ref):
10481052
mustClose = True
@@ -1667,6 +1671,10 @@ def process_pr(repo_config, gh, repo, issue, dryRun, cmsbuild_user=None, force=F
16671671
if not dryRun:
16681672
issue.edit(state="open")
16691673

1674+
if pr and pr.state == "closed" and not reOpen:
1675+
logger.info("PR is closed and reopen not requested - quitting")
1676+
return
1677+
16701678
if issue.pull_request:
16711679
if (
16721680
pr.commits >= TOO_MANY_COMMITS_WARN_THRESHOLD

0 commit comments

Comments
 (0)