This repository will hold scripts and other tools that make it easier to manage and define policy for the GitHub Policy Service.
Prerequisites:
- Logged in with GitHub CLI
- Admin access to the repositories.
The branch_protection_export.ps1 script is used to export existing branch protection rules into the yaml format supported by the GitHub Policy Service.
The branch_protection_bulk_export.ps1 script is used to export bulk existing branch protection rules into the yaml format supported by the GitHub Policy Service.
Workflow
The suggested workflow is:
- Export existing branch protection rules in the yaml file.
- Check-in existing branch protection rules file at /.github/policies/.
- Validate the rules are working as expected.
- Update the branch protection rules in the yaml file and open PR.
Now you have gitop enabled your branch protection rules.