-
Notifications
You must be signed in to change notification settings - Fork 5.3k
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
Provide gh cli Support to Revert Pull Request #6034
Comments
Thanks for the feature request! Agreed that this would be useful, but I do not think there is an API to revert a merged PR. Until then, we cannot act on adding this to CLI. In the meantime, you can use
|
There's a |
@azizshamim @mislav Any chance there has been any progress here? |
This URL is for use in the browser; the best the CLI could do is link to it. |
One team is migrating from Gerrit and want to mimic some of the capabilities that Gerrit has. Gerrit has What they are planning to do is link a set of PRs (to simulate the |
Update: the platform team just shipped a new API to revert a PR with: mutation ($pr: ID!, $asDraft: Boolean = false, $title: String, $body: String) {
revertPullRequest(
input: {
title: $title,
body: $body,
draft: $asDraft,
pullRequestId: $pr,
}
) {
revertPullRequest {
url
}
}
} You can already use this as so: # reads the query from a file:
gh api graphql -F query=@revertPullRequest.graphql -f 'pr=<PR-ID>' How should we expose this as a command in gh?
|
I feel like When you revert a PR, you're not inherently "undoing" the merge, you're rather making a new change that reverts the commit itself. |
@5HT2: that's a good point. A new command |
@mislav How does work prioritization work for |
Work prioritization looks like this: if something is tagged Eventually, our team might also pick up this work, but before we manage to get to it, anyone is welcome to! |
What's needed to help the PR progress to being reviewed and (hopefully) merged? I'm pretty interested in using this functionality after trying out the GraphQL approach with some success. |
Describe the feature or problem you’d like to solve
To support automation and CI/CD it would be beneficial for the GitHub CLI to support reverting a pull request equivalent to what the UI is able to accomplish.
Proposed solution
gh pr revert 416967111
Additional context
In a multi-contributor, pull-request managed repository there are limits to what linting/formating/plan (e.g. terraform plan) can achieve before attempting to deploy (e.g. terraform apply). To increase velocity, and minimize effort required by maintainers, it would be beneficial to be able to revert a PR following a failed build/deploy.
The text was updated successfully, but these errors were encountered: