pwntester / octo.nvim

Edit and review GitHub issues and pull requests from the comfort of your favorite editor
MIT License
2.33k stars 125 forks source link

Feature - Respect PR template when creating a new PR. #304

Closed shivanthzen closed 1 year ago

shivanthzen commented 2 years ago

Issue Description

Type: feature request

Describe

When creating a new PR using octo, repect the Pull request template stored in .github/PULL_REQUEST_TEMPLATE.md of the REPO . Currently Octo creates a PR with empty descritption.

References

https://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/creating-a-pull-request-template-for-your-repository

pwntester commented 2 years ago

Thanks for filing an issue, this is something I wanted to do but didnt get the time to tackle it yet.

Seems like the templates are available via the GraphQL API:

augustocdias commented 2 years ago

Would be nice to also have the possibility to open the PR as a draft.

shivanthzen commented 2 years ago

You can create draft PR with :Octo pr create draft

shivanthzen commented 2 years ago

To the original question, looks like gh cli already supports choosing template when I do gh pr create. Its just a matter of letting piping the ourput to a select window ? Never mind just realised octo doesn't use gh

augustocdias commented 2 years ago

To the original question, looks like gh cli already supports choosing template when I do gh pr create. Its just a matter of letting piping the ourput to a select window ?

Never mind just realised octo doesn't use gh

No? Then why it is on the dependencies' list?

pwntester commented 2 years ago

No? Then why it is on the dependencies' list?

It uses gh to send most of the graphql/rest requests but does not use the gh commands directly if that makes sense So to create a new pr, we use gh api ... to send a request to the correct graphql API endpoint, but do not use gh pr create command

pwntester commented 2 years ago

I started working on this, you can check this PR https://github.com/pwntester/octo.nvim/pull/313 and let me know any bugs/thoughts