-
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
pr create
should have option to not require any commits/changes
#9112
Comments
Thanks for the request. I'm a bit confused how
But then I looked at how
And indeed using the REST API directly shows the same thing:
I'll do a bit more investigation in the meantime but perhaps you know what obvious thing I'm missing? |
I guess what I'd like to know is what the state of the PR is when you use And in fact if your branches are indeed exactly the same I would expect the script to exit before Perhaps you could take a screenshot of the commits of a newly created PR from I get the sense something else is going on here because I can't see any way in which GitHub will allow you to create a truly empty PR. |
Hmm... I'm realizing that our existing workflows work on branches that do have changes and/or merge commits and it doesn't work the way I suspected when there aren't commits. I still think this would be a good feature even if it isn't exactly how it worked in the other tool, since I would like to automate the creation of branches and creating prs back into the source branch. |
I'm afraid it's not possible sorry, the GitHub platform itself isn't designed to work that way as you can see from the API responses. I can mention it to the team that owns pull requests but being realistic, it's very unlikely that such a core decision would be reviewed. If you really wanted to do this you'd probably have to do something like |
Closing this because it's not going to be addressed on the platform and there's no way we can get around it, sorry. Best of luck with your workflows. |
Describe the feature or problem you’d like to solve
We automate parts of our deploy workflow, including making release branches. In one type of release workflow we create a new release branch from main and then immediately make a PR back into main. Later we come back and do work on that release branch, and when it's done we merge in the PR. (this is slightly simplified, but those are the relevant parts of our workflow.
When I try to create a PR without immediately adding changes I get the error:
Proposed solution
Provide a flag, such as
--allow-empty
that will let us create a PR with no changes.Additional context
We are currently using
repo-sync/pull-request@v2
which provides the optionpr_allow_empty: true
but no such option is available in the github cli. That repo now recommends using the gh cli.The text was updated successfully, but these errors were encountered: