We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f1f9009 commit b71251bCopy full SHA for b71251b
justfile
@@ -31,7 +31,11 @@ build-website:
31
# Run checks on commits with non-main branches
32
check-commits:
33
#!/bin/zsh
34
- if [[ $(git rev-parse --abbrev-ref HEAD) != "main" ]]
+ branch_name=$(git rev-parse --abbrev-ref HEAD)
35
+ number_of_commits=$(git rev-list --count HEAD ^$branch_name)
36
+ if [[ ${branch_name} != "main" && ${number_of_commits} -gt 0 ]]
37
then
38
poetry run cz check --rev-range main..HEAD
39
+ else
40
+ echo "Not on main or haven't committed yet."
41
fi
0 commit comments