Skip to content

Commit

Permalink
fix(ci): synchronize git hooks on pnpm install
Browse files Browse the repository at this point in the history
  • Loading branch information
saisatishkarra committed Jan 25, 2025
1 parent e67551e commit 4e6fc4f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,12 @@ Refer to the official Lefthook [installation guide](https://github.com/evilmarti
---

## Step 4: Sync Lefthook Hooks
This repo should already contain a `lefthook.yml` configuration file in the root directory. The configuration in the lefthook.yml file enforces commit message linting using Commitlint.
Package.json runs the below command as part of `pnpm install` to sync the Lefthook configuration with your Git hooks:
This repo should already contain a `lefthook.yml` configuration file in the root directory.

The lefthook hooks are synced as part of `pnpm install` command using a `postinstall` hook that runs the below command automatically

```bash
lefthook run pre-commit
lefthook install
```

---
Expand Down Expand Up @@ -75,4 +76,4 @@ By setting up Lefthook, you ensure that all developers adhere to the commit mess
This guide will help you install and configure zizmor to analyze GH workflows and Actions locally.

## Step 1: Install zizmor
Run `pip install zizmor` to install all the dependencies.
Installed as dependency during `pnpm install` along with all the other dependencies.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"lint": "eslint '**/*.{js,jsx,ts,tsx,vue}' --ignore-path '.eslintignore'",
"install-python-dependencies": "pip install -r requirements.txt",
"prepare": "pnpm run install-python-dependencies",
"postinstall": "lefthook install",
"pre-commit": "lefthook run pre-commit"
},
"keywords": [],
Expand Down

0 comments on commit 4e6fc4f

Please sign in to comment.