Skip to content

Commit

Permalink
chore: prevent commit to local main branch (#4797)
Browse files Browse the repository at this point in the history
  • Loading branch information
RogerHYang authored Oct 1, 2024
1 parent 9af3fb8 commit 80c23ad
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,10 @@ repos:
- eslint-plugin-react@7.33.2
- eslint-plugin-react-hooks@4.6.0
- eslint-plugin-simple-import-sort@10.0.0
- repo: local
hooks:
- id: forbid-commit-to-local-main-branch
name: Check branch before committing
entry: bash -c '[[ "$(git rev-parse --abbrev-ref HEAD)" != "main" ]] || { echo "Should not commit to local main branch."; exit 1; }'
language: system
stages: [ commit ]

0 comments on commit 80c23ad

Please sign in to comment.