Using Githooks for CI/CD

Using Githooks for CI/CD

A tutorial on how to to use git-scripts for CI/CD

Create the package.json

Create a package.json by running:

npm init

Install git-scripts to the package by running:

npm install --save-dev git-scripts

Add the Git Hooks

After the devDependencies section, add:

  "devDependencies": {
    "git-scripts": "^0.2.1"
  },
  "git": { 
    "scripts": { 
      "pre-push": "<command(s) to run before git push>" 
    } 
  }