I'm migrating from the REST API v3 to the GraphQL API v4.
Is there a GraphQL mutation similar to REST API's "PUT /repos/:owner/:repo/branches/:branch/protection" to allow force pushes to the protected branch?
With the REST API, I can create a branch protection rule and set allow_force_pushes: true.
For added context, in the GitHub UI this is the setting I'm trying to change via GraphQL API:
Solved! Solved! Go to Solution.
Per GitHub Support, the GraphQL API doesn't expose this option.
Thanks for reaching out and asking us about this! The GraphQL API doesn't currently expose that field today, though it could change in the future. We don't have a timeline for if or when that would happen, though we encourage you to subscribe to our changelog: https://developer.github.com/v4/changelog/
As a workaround, we suggest continuing to use the REST API endpoint for updating that setting.