Skip to content

run husky only on specific branch #1435

Answered by neslob
phifa asked this question in Q&A
Discussion options

You must be logged in to vote
#!/usr/bin/env bash

main_branch="main"

branch="$(git rev-parse --abbrev-ref HEAD)"

if [ "$branch" = "$main_branch" ]; then
  echo "Do $main_branch' stuff." 
fi

# uncomment to test
# exit 1

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by typicode
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants