Just a simple helper to protect branches using restrictions

Usage no npm install needed!

<script type="module">
  import cirocfcYetAnotherGithubBranchProtectionTool from 'https://cdn.skypack.dev/@cirocfc/yet-another-github-branch-protection-tool';


npm Commitizen friendly


Just a simple helper to protect Github branches using Octokit and restrictions.


yarn add @cirocfc/yet-another-github-branch-protection-tool

Create a config directory and place in it both your defaults.yaml and projects.yaml configuration.


In order to use this package, you must provide a GITHUB_TOKEN environment variable with a Personal access tokens. If you don't have one, go ahead and create it.

After setting the GITHUB_TOKEN value, you can run the commands:

  • To lock a branch:

    yarn ya-protect-branch --project=<project-name-from-projects.yaml> --locked
  • To unlock a branch:

    yarn ya-protect-branch --project=<project-name-from-projects.yaml>

That's it. Enjoy!