Skip to content

Commit

Permalink
chore: don't run cz if current commit is the same as the latest main …
Browse files Browse the repository at this point in the history
…branch commit
  • Loading branch information
shivaraj-bh committed Sep 24, 2024
1 parent 9c6e394 commit 4635e56
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions dev/flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,14 @@
default_branch=$(git remote show origin | grep 'HEAD branch' | cut -d' ' -f5)
# Get the latest commit on the default branch
# rev range using the `default_branch` branch name (e.g. main..HEAD), doesn't work in Github Actions
latest_default_commit=$(git rev-parse origin/"$default_branch")
commit_count=2
current_commit=$(git rev-parse HEAD)
if [ "$commit_count" -eq 0 ]; then
if [ "$latest_default_commit" = "$current_commit" ]; then
echo "No commits to check between $default_branch and HEAD."
else
echo "Checking $commit_count commit(s)..."
cz check --rev-range "$latest_default_commit"..HEAD
fi
'';
Expand Down

0 comments on commit 4635e56

Please sign in to comment.