From 4364b9865edd298191ecbc5f297e4e15f4d9c28c Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 12 Mar 2026 02:25:22 +0000 Subject: [PATCH 1/3] Initial plan 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 2/3] 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.'); From f461876e8a49288d7c5faffcf0ac9604cba34b74 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 12 Mar 2026 16:30:09 +0000 Subject: [PATCH 3/3] Add pull_request trigger to mark-prs-ready-for-review workflow Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com> --- .../workflows/mark-prs-ready-for-review.yml | 41 +++++++++++++------ 1 file changed, 28 insertions(+), 13 deletions(-) diff --git a/.github/workflows/mark-prs-ready-for-review.yml b/.github/workflows/mark-prs-ready-for-review.yml index c1fe5f2ac..225d4a005 100644 --- a/.github/workflows/mark-prs-ready-for-review.yml +++ b/.github/workflows/mark-prs-ready-for-review.yml @@ -1,6 +1,8 @@ name: Mark Pull Requests Ready for Review on: + pull_request: + types: [opened] workflow_dispatch: schedule: - cron: '0 0 * * *' @@ -17,17 +19,8 @@ jobs: 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.`); + async function markReady(nodeId, number, title) { + core.info(`Marking PR #${number} "${title}" ready for review.`); try { await github.graphql(` mutation($id: ID!) { @@ -35,9 +28,31 @@ jobs: pullRequest { number isDraft } } } - `, { id: pr.node_id }); + `, { id: nodeId }); } catch (err) { - core.warning(`Failed to mark PR #${pr.number} ready for review: ${err.message}`); + core.warning(`Failed to mark PR #${number} ready for review: ${err.message}`); + } + } + + if (context.eventName === 'pull_request') { + const pr = context.payload.pull_request; + if (pr.draft) { + await markReady(pr.node_id, pr.number, pr.title); + } else { + core.info(`PR #${pr.number} is already ready for review. Nothing to do.`); + } + } else { + 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) { + await markReady(pr.node_id, pr.number, pr.title); } }