1.0.8 • Published 6 years ago

enforce-gitflow-branches v1.0.8

Weekly downloads
81
License
MIT
Repository
github
Last release
6 years ago

Enforces Git branch names according to the Git Flow branching model.

Usage:

$ yarn add -D enforce-gitflow-branches husky@next
or
$ npm install --save-dev enforce-gitflow-branches husky@next

Then set up Husky and set a hook:

"husky": {
  "hooks": {
    "pre-push": "enforce-gitflow-branches"
  }
}

This script checks the current branch name and exits the Node process with exit code 0 if it is valid (see source). If the branch name is invalid it exits with exit code 1, which causes Husky to prevent the action from completing.

To write custom controls create a file with:

// enforce.js
const enforce = require('enforce-gitflow-branches')
enforce()

// ...other tests

To add custom branch names in your custom controls, use node-current-branch to access the current branch name.

Finally set up Husky and set a hook:

"husky": {
  "hooks": {
    "pre-push": "node enforce.js"
  }
}
1.0.8

6 years ago

1.0.7

6 years ago

1.0.6

6 years ago

1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago