sindresorhus/refined-github

convert issue to pull request #2614

graingert posted onGitHub

<!-- Thanks for contributing! 🏓 -->

by creating a PR with the API using {"issue": <issuenumber>} you can convert that issue into a PR

Here's an example of this undocumented API feature in use by Hub:

https://github.com/github/hub/blob/7b02a665ddacd885ad017a7c6904e662c8417bf8/commands/pull_request.go#L53-L59 https://github.com/github/hub/blob/7b02a665ddacd885ad017a7c6904e662c8417bf8/commands/pull_request.go#L350-L353

Example URL:

<!-- Please specify a URL where the feature should appear -->


posted by graingert over 5 years ago

Interesting, thanks for the links. However I can't find a way to do this outside hub; we can't use a command line tool.

posted by fregante over 5 years ago

@fregante that's odd, hub is just using the v3 API which is available to refined-github

posted by graingert over 5 years ago
posted by fregante over 5 years ago

I think it's undocumented

posted by graingert over 5 years ago

Although it seems it was documented and marked deprecated, then the deprecation removed: https://github.com/github/hub/issues/2038#issuecomment-473795000

posted by graingert over 5 years ago

Here's some more discussion about the API being un-deprecated https://github.com/github/hub/issues/1927

posted by graingert over 5 years ago

Honestly it's not a workflow I'd like to highlight on the web. It may sound good on private projects but sometimes an issue ends up with many PRs. The current "PR fixes Issue" standard is preferable on most projects.

If you need this feature, I'd suggest creating a separate extension so only those who need it have it.

From what I understand, you call the "update issue" API¹ and provide all the parameters you'd send to the "create PR" API ²

¹ https://github.com/github/hub/blob/7b02a665ddacd885ad017a7c6904e662c8417bf8/github/client.go#L778 ² https://github.com/github/hub/blob/7b02a665ddacd885ad017a7c6904e662c8417bf8/commands/pull_request.go#L335-L353

posted by fregante over 5 years ago

Fund this Issue

$0.00
Funded

Pull requests