README
Align repository settings, branch protection rules and repository collaborators across all your repositories.
Prerequisites
- you should have a Node.js installed on your machine;
- Harmonizer is communicating with the GitHub REST API, that's why you need to have your GitHub personal access token ready;
Installation
Firstly, install Harmonizer locally, from the root of the dsm-github-harmonizer
repository run:
npm install
Then, setup your Harmonizer rules in the .harmonizerrc.json file.
Harmonizer uses a JSON Schema declared in the config.schema.json file. It provides a clear human- and machine- readable documentation for the Harmonizer. It is also used in order to annotate and validate its configuration. It also provides code suggestions and annotations within your IDE if you are using VS Code.
If you prefer to have your configuration in
YAML
, feel free to replace your.harmonizerrc.json
config with a.harmonizerrc.yaml
and hold your configuration there instead. TheJSON Schema
benefits above would also be working for you.
Usage
Run the following command and follow the instructions:
npm start
Features
Harmonizer aligns these repository settings:
- controls visibility of
wiki
,projects
andissues
tabs; - controls visibility of
squash merge
,merge commits
andrebase merge
buttons in the pull requests; - controls the automated
delete branch on merge
option;
Harmonizer manages repository collaborators:
- adds teams and users to the repo as collaborators;
- grants permissions to the collaborators or updates them;
Harmonizer sets protection rules for the default branch of the repository:
- sets the amount of required PR approvals before merge;
- controls whether to dismiss the stale pull request approvals when new commits are pushed or not;
- controls whether to require review from Code Owners or not;
- controls whether to require branches to be up to date before merging or not;
- controls whether to disallow users with push access to delete the default branch or not;
- controls whether to enable merge commits from being pushed to the default branch or not;
- controls whether to enforce all configured restrictions above for administrators or not;
- controls whether to disallow force pushes for all users with push access or not;
- controls whether to disallow users with push access to delete the default branch or not;
TODO
- cover functionality with tests;
- publish as an npm library;
- make harmonizer consume external config;