Skip to content

trufflehq/yarn-plugin-git-hooks

Repository files navigation

yarn-plugin-git-hooks

Yarn Berry plugin for easy Git Hooks.

Installation

yarn plugin import https://raw.githubusercontent.com/trufflehq/yarn-plugin-git-hooks/main/bundles/%40yarnpkg/plugin-git-hooks.js

Usage

  1. Create your Git Hooks. We recommend .github/hooks.

Warning

Make sure they are are executable (chmod +x ./commit-msg)!

hint: The '.github/hooks/commit-msg' hook was ignored because it's not set as executable.
  1. Specify the path to your Git Hooks directory in .yarnrc.yml:
gitHooksPath: .github/hooks

Now, every time you run yarn (once packages are installed), your hooks will be configured.

Note

You can check the configuration succeeded with git config --get core.hookspath.

Warning

This plugin is not compatible with Docker.
To disable, set YARN_DISABLE_GIT_HOOKS=1.

ENV YARN_DISABLE_GIT_HOOKS=1

or