octokit.net
octokit.net copied to clipboard
Is there a way to update wildcard branch protection rules?
I'm working on a script to manage branch protection rules for all our repos and while I can update eg. required status checks for a given branch like
var update = new BranchProtectionRequiredStatusChecksUpdate(false, myRequiredContexts);
await client.Repository.Branch.UpdateRequiredStatusChecks(organization, repoName, "master", update);
I can't find a way to do it for our rule for release-* branches. Any ideas on how I can solve this?

Any update on this?
Any update on this?
Is there anything I or anyone else can do to help get this prioritised?
@adamralph Very late response, apologies. It looks like the github api itself can't handle this and it has been requested for a long time. It is possible to do via the GraphQl integration though.
@JonruAlveus thanks. Is there an issue I can monitor for the API addition?
@adamralph here’s a community forum post I saw
https://github.community/t/rest-api-v3-wildcard-branch-protection/13593
and one around graphql
https://github.community/t/how-to-read-wildcard-branch-protection-rules-using-the-api/196464
I can’t find open issues on GitHub itself but the api docs require the branch name in the path of the request which implies the branch has to exist to apply the protection (where wildcards don’t exist).
Which version will this be released in?
@adamralph apologies... I didn't mean to close this - I'm going to pin it so that stale bot doesn't get it and give a priority. While we won't be able to get to this in the near term, please consider opening up a PR on this, and we'd be glad to get it reviewed and merged in. Thank you for keeping up with this and helping the community out! ❤️
@nickfloyd has the api been updated to support wildcards as previously it couldn’t?
@JonruAlveus Not yet; I was going to put a blocked tag on this and put it in the backlog until we hear from the owning team.
👋 Hey Friends, this issue has been automatically marked as stale because it has no recent activity. It will be closed if no further activity occurs. Please add the Status: Pinned label if you feel that this issue needs to remain open/active. Thank you for your contributions and help in keeping things tidy!