-
-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Toggle pull-request draft status (#485)
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)
- Loading branch information
Showing
16 changed files
with
506 additions
and
291 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.