octokit.net icon indicating copy to clipboard operation
octokit.net copied to clipboard

Is there a way to update wildcard branch protection rules?

Open andreasohlund opened this issue 5 years ago • 10 comments
trafficstars

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?

image

andreasohlund avatar Apr 23 '20 15:04 andreasohlund

Any update on this?

adamralph avatar Jun 23 '20 16:06 adamralph

Any update on this?

adamralph avatar Mar 06 '21 19:03 adamralph

Is there anything I or anyone else can do to help get this prioritised?

adamralph avatar Jul 28 '21 11:07 adamralph

@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 avatar Jul 14 '22 06:07 JonruAlveus

@JonruAlveus thanks. Is there an issue I can monitor for the API addition?

adamralph avatar Jul 14 '22 07:07 adamralph

@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).

JonruAlveus avatar Jul 15 '22 04:07 JonruAlveus

Which version will this be released in?

adamralph avatar Nov 03 '22 17:11 adamralph

@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 avatar Nov 03 '22 17:11 nickfloyd

@nickfloyd has the api been updated to support wildcards as previously it couldn’t?

JonruAlveus avatar Nov 03 '22 18:11 JonruAlveus

@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.

nickfloyd avatar Nov 03 '22 19:11 nickfloyd

👋 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!

github-actions[bot] avatar Apr 20 '24 01:04 github-actions[bot]