mirror of
https://github.com/Sea-Haven-Industries/open-swe.git
synced 2026-10-01 08:33:14 +00:00
fix: Properly open a PR as ready for review (#579)
* fix: Properly open a PR as ready for review * cr
This commit is contained in:
parent
f6a5065093
commit
d0fe5f5323
1 changed files with 28 additions and 1 deletions
|
|
@ -271,14 +271,41 @@ export async function markPullRequestReadyForReview({
|
|||
auth: token,
|
||||
});
|
||||
|
||||
// Fetch the PR, as the markReadyForReview mutation requires the PR's node ID, not the pull number
|
||||
const { data: pr } = await octokit.pulls.get({
|
||||
owner,
|
||||
repo,
|
||||
pull_number: pullNumber,
|
||||
});
|
||||
|
||||
await octokit.graphql(
|
||||
`
|
||||
mutation MarkPullRequestReadyForReview($pullRequestId: ID!) {
|
||||
markPullRequestReadyForReview(input: {
|
||||
pullRequestId: $pullRequestId
|
||||
}) {
|
||||
clientMutationId
|
||||
pullRequest {
|
||||
id
|
||||
number
|
||||
isDraft
|
||||
}
|
||||
}
|
||||
}
|
||||
`,
|
||||
{
|
||||
pullRequestId: pr.node_id,
|
||||
},
|
||||
);
|
||||
|
||||
const { data: updatedPR } = await octokit.pulls.update({
|
||||
owner,
|
||||
repo,
|
||||
pull_number: pullNumber,
|
||||
title,
|
||||
body,
|
||||
draft: false,
|
||||
});
|
||||
|
||||
logger.info(`Pull request #${pullNumber} marked as ready for review.`);
|
||||
return updatedPR;
|
||||
},
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue