question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

convert issue to pull request

See original GitHub issue

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:

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
graingertcommented, Dec 10, 2019

I think it’s undocumented

0reactions
fregantecommented, Dec 11, 2019

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

Read more comments on GitHub >

github_iconTop Results From Across the Web

Linking a pull request to an issue - GitHub Docs
On GitHub.com, navigate to the main page of the repository. Under your repository name, click Issues.
Read more >
Converting Github issues into pull requests - David Winterbottom
Using the Hub library, it's possible to convert Github issues into pull requests. This gives rise to a useful Github workflow which this ......
Read more >
Convert Github pull-request to issue - Stack Overflow
You can't convert the pull-request back to an issue. The conversion to a pull-request is done by hub with the github api.
Read more >
Convert a GitHub Issue Into a Pull Request - Brandon Keepers
A little-known-feature of the GitHub API is the ability to attach changes to an issue, converting it into a pull request.
Read more >
How to open a pull request - Axolo
When the code is ready to be reviewed, the developer can convert its draft pull request to ready for review, or open the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found