From 13161247f4c4b9b714fdbf181f02d8b09f26f0fd Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 23 Oct 2026 14:28:51 +0000 Subject: [PATCH] mark-pr-ready: fall back to GraphQL when the CCR draft route is missing The CCR convert_to_draft route only exists inside Claude Code sessions; in GitHub Actions it returns 404 and aborted the whole run. Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_01WLrKmVNbTh8QfP71a78k8b --- ci_scripts/mark-pr-ready.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/ci_scripts/mark-pr-ready.py b/ci_scripts/mark-pr-ready.py index 8d44747379e6..9958e9f15638 100755 --- a/ci_scripts/mark-pr-ready.py +++ b/ci_scripts/mark-pr-ready.py @@ -52,8 +52,10 @@ def convert_to_draft(token: str, pr: PullRequest) -> None: PyGithub's PullRequest.convert_to_draft() calls GitHub's GraphQL API, which Claude Code sessions cannot reach (the REST API has no classic - endpoint for this direction either). Use the CCR REST route the - platform provides instead; it works the same everywhere else too. + endpoint for this direction either), so try the CCR REST route the + platform provides first. That route only exists inside those sessions; + anywhere else (e.g. GitHub Actions) it answers 404 and the GraphQL call + is used instead. """ response = requests.post( f"https://api.github.com/repos/{REPOSITORY}/pulls/{pr.number}/ccr/convert_to_draft", @@ -63,6 +65,9 @@ def convert_to_draft(token: str, pr: PullRequest) -> None: }, timeout=30, ) + if response.status_code == 404: + pr.convert_to_draft() + return response.raise_for_status()