Github Branch Protection rule from Jenkins

Is there an automated way to enable branch protection rule in multiple repositories (more than 50 repos) from Jenkins?

You can use the API to create branch protection rules on multiple repositories:

https://docs.github.com/en/rest/reference/repos#update-branch-protection

1 Like