From 0060608d73ae4a8d3be9c231b40838b757c850c9 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 12 Mar 2026 02:27:32 +0000 Subject: [PATCH] Add workflow to mark all draft pull requests ready for review Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com> --- .../workflows/mark-prs-ready-for-review.yml | 44 +++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 .github/workflows/mark-prs-ready-for-review.yml diff --git a/.github/workflows/mark-prs-ready-for-review.yml b/.github/workflows/mark-prs-ready-for-review.yml new file mode 100644 index 000000000..c1fe5f2ac --- /dev/null +++ b/.github/workflows/mark-prs-ready-for-review.yml @@ -0,0 +1,44 @@ +name: Mark Pull Requests Ready for Review + +on: + workflow_dispatch: + schedule: + - cron: '0 0 * * *' + +permissions: {} + +jobs: + mark-ready: + runs-on: ubuntu-latest + permissions: + pull-requests: write + steps: + - name: Mark all draft pull requests ready for review + uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8 + with: + script: | + const pulls = await github.paginate(github.rest.pulls.list, { + owner: context.repo.owner, + repo: context.repo.repo, + state: 'open', + }); + + const drafts = pulls.filter(pr => pr.draft); + core.info(`Found ${drafts.length} draft pull request(s).`); + + for (const pr of drafts) { + core.info(`Marking PR #${pr.number} "${pr.title}" ready for review.`); + try { + await github.graphql(` + mutation($id: ID!) { + markPullRequestReadyForReview(input: { pullRequestId: $id }) { + pullRequest { number isDraft } + } + } + `, { id: pr.node_id }); + } catch (err) { + core.warning(`Failed to mark PR #${pr.number} ready for review: ${err.message}`); + } + } + + core.info('Done.');