-
-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
proposal: Add action to turn PR into Draft and vice-versa #436
Comments
Hi, there. Thank you @Andre601 for suggesting this.
|
Unfortunately, the latest GitHub REST API v3 and client seem not to have the capability to change the status of |
I have opened the request. octokit/rest.js#69 |
Hi, there. Thank you for suggesting documentation improvement.
|
I have found the following previous requests and subscribed.
Also, I learned that GitHub GraphQL API has the ability to change the pull-request status with the next functions. I will investigate those. |
Close #436 ## Overview My proposal about a REST API to toggle pull-request draft status ([pulls.update: Change pull-request draft status · Issue #69 · octokit/rest.js](octokit/rest.js#69)) has been rejected since the GitHub API v4 (GraphQL API) has the ability to do that. Unfortunately, an auto-generated access token called `GITHUB_TOKEN` seems not to have full control permission of the GraphQL API. We got the error `Resource not accessible by integration` with the GitHub API v4 and `GITHUB_TOKEN`. This problem may be related to the following thread. - [API v4 - Unable to Retrieve Email - Resource not accessible by integration - GitHub Ecosystem - GitHub Support Community](https://github.community/t/api-v4-unable-to-retrieve-email-resource-not-accessible-by-integration/13831/3) This pull-request uses a personal access token with a `public_repo` scope (for a public repository) as a workaround. ## References - [convertPullRequestToDraft - Mutations - GitHub Docs](https://docs.github.com/en/graphql/reference/mutations#convertpullrequesttodraft) - [markPullRequestReadyForReview - Mutations - GitHub Docs](https://docs.github.com/en/graphql/reference/mutations#markpullrequestreadyforreview) - https://github.com/actions/toolkit/blob/%40actions/tool-cache%401.1.1/packages/github/README.md?plain=1#L32 - [octokit/graphql.js: GitHub GraphQL API client for browsers and Node](https://github.com/octokit/graphql.js) - [octokit/graphql-schema: GitHub’s GraphQL Schema with validation. Automatically updated.](https://github.com/octokit/graphql-schema)
Is your feature request related to a problem? Please describe.
N/A
Describe the solution you'd like
There should be additional actions to turn a PR into a Draft or turn a Draft into a PR.
Perhaps the
open
action could be re-used here to do draft -> PR?Describe alternatives you've considered
Doing it manually... obviously.
Additional context
We have a specific setup for PRs in a repository, where a PR is a draft until it's ready for review and merge in which case it will receive a
Status: Ready
label, where the comment action comments about this change.Having a way to directly change the PRs draft-status on (un)label would allow us to remove one extra step (Lazyness for the win!)
The text was updated successfully, but these errors were encountered: