From 40de2f98cdb235346c33f9cb646fde28b3ace56e Mon Sep 17 00:00:00 2001 From: Ludovic Henry Date: Fri, 30 Oct 2026 07:05:54 +0000 Subject: [PATCH] mark-pr-ready: treat a 403 on merge as a rejection too --- ci_scripts/mark-pr-ready.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ci_scripts/mark-pr-ready.py b/ci_scripts/mark-pr-ready.py index 9958e9f15638..12e800d39e55 100755 --- a/ci_scripts/mark-pr-ready.py +++ b/ci_scripts/mark-pr-ready.py @@ -44,7 +44,7 @@ REPOSITORY = "riseproject-dev/python-wheels" PASSING_CONCLUSIONS = {"success", "skipped"} -MERGE_REJECTED_STATUSES = {405, 409, 422} +MERGE_REJECTED_STATUSES = {403, 405, 409, 422} def convert_to_draft(token: str, pr: PullRequest) -> None: @@ -137,9 +137,9 @@ def sync_pull_request( result = pr.merge(merge_method="squash", sha=pr.head.sha) except GithubException as exc: # GitHub answers 405 when the PR cannot be merged (e.g. merge - # conflicts), 409 when its head moved since we looked, and - # 422 for other validation failures. These affect only this - # PR, so report them and carry on with the rest. + # conflicts), 409 when its head moved since we looked, 422 for other + # validation failures and 403 when the token may not merge it. These + # affect only this PR, so report them and carry on with the rest. if exc.status not in MERGE_REJECTED_STATUSES: raise message = (