DEV Community

Kyle Schwartz
Kyle Schwartz

Posted on

3

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
Enter fullscreen mode Exit fullscreen mode

Install git-scripts to the package by running:

npm install --save-dev git-scripts
Enter fullscreen mode Exit fullscreen mode

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>" 
    } 
  }
Enter fullscreen mode Exit fullscreen mode

Top comments (0)

Heroku

This site is powered by Heroku

Heroku was created by developers, for developers. Get started today and find out why Heroku has been the platform of choice for brands like DEV for over a decade.

Sign Up

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay