Skip to content

Latest commit

 

History

History
45 lines (28 loc) · 1.27 KB

README.md

File metadata and controls

45 lines (28 loc) · 1.27 KB

GIT HOOKS

A collection of opinionated git hooks to automate part of our workflow

Sentences you will never hear again

  • Someone leaked a database key, we need to regenerate it. @here update all your local secret files.
  • Oops! I forgot to fix tests, too.
  • LGTM but fix lint errors before merging.
  • After merging your branch it doesn't compile anymore! | Have you tried yarn install? | oops...

Features

  • Prevent from committing secrets
  • Update dependencies when switching/merging branches
  • Prevent from pushing untested code
  • Prepend the storyid to the commit message if the branch is in the shape storyId-description where storyId is expected to be a number.

Requirements

  • git-secrets - see here for more info.

Installation

From a remote script

cd into your target project's root and then

bash <(curl -s https://raw.githubusercontent.com/pagopa/git-hooks/master/install.sh)

Locally

Clone this repository anywhere in your machine, cd into your target project's root and then

path/to/git-hooks-repo/install.sh 1

Alternatively, pick any hook you like in ./hooks folder and copy&paste into the .git/hooks folder of your project.

Hooks

See ./hooks folder for details