Can't disable Allow Force Pushes via REST API #180482
Replies: 2 comments 1 reply
-
|
💬 Your Product Feedback Has Been Submitted 🎉 Thank you for taking the time to share your insights with us! Your feedback is invaluable as we build a better GitHub experience for all our users. Here's what you can expect moving forward ⏩
Where to look to see what's shipping 👀
What you can do in the meantime 💻
As a member of the GitHub community, your participation is essential. While we can't promise that every suggestion will be implemented, we want to emphasize that your feedback is instrumental in guiding our decisions and priorities. Thank you once again for your contribution to making GitHub even better! We're grateful for your ongoing support and collaboration in shaping the future of our platform. ⭐ |
Beta Was this translation helpful? Give feedback.
-
|
Sooo... from the REST docs, As soon as you switch to “Specify who can force push” and have a non-empty list of actors, the REST Right now the only reliable workarounds seem to be:
Based on the current REST docs and your repro, I’d definitely classify this as a GitHub bug / missing REST support for the “Specify who can force push” variant rather than misusing the endpoint |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Select Topic Area
Bug
Body
Given a repo with allow force pushes enabled

(doesn't matter if it allows everyone or specific people/teams/apps):Trying to disable it via REST API (according to https://docs.github.com/en/rest/branches/branch-protection?apiVersion=2022-11-28#update-branch-protection) never works:
setting to false:
or setting to null:
or not sending it as part of the payload:
Am I missing something? This looks a lot like a bug to me.
Cheers,
UPDATE: bug is happening only when specific people/teams/apps are added to the "Specify who can force push" list. I just re-tested and when "Everyone" is selected, the REST API call could disable it
Beta Was this translation helpful? Give feedback.
All reactions