Skip to content

Little utility to be used in conjunction with Husky to enforce a branch naming convention

License

Notifications You must be signed in to change notification settings

tiaanduplessis/enforce-branch-name

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

enforce-branch-name

package version package downloads standard-readme compliant package license make a pull request

Little utility to enforce a branch naming convention

Table of Contents

Install

With npm:

npm install --save-dev enforce-branch-name

With yarn:

yarn add -D enforce-branch-name

With pnpm:

pnpm add -D enforce-branch-name

Usage

Enforce that a branch starts with the prefix hotfix/, bugfix/ or /feature. Ignore this check if on the staging branch:

enforce-branch-name '(hotfix|bugfix|feature)\/.+' --ignore 'staging'

With husky

First make sure husky is installed and configured. Then configure your hook pre-push hook:

// package.json
{
  "husky": {
    "hooks": {
      "pre-push": "enforce-branch-name '(hotfix|bugfix|feature)\/.+' --ignore 'staging'",
    }
  }
}

Contributing

Got an idea for a new feature? Found a bug? Contributions are welcome! Please open up an issue or make a pull request.

License

MIT © Tiaan du Plessis

About

Little utility to be used in conjunction with Husky to enforce a branch naming convention

Topics

Resources

License

Stars

Watchers

Forks

Packages