Skip to content

Commit

Permalink
Merge pull request #206 from openshift-kni/fix-commit-check-4.14
Browse files Browse the repository at this point in the history
[KNI][4.14] fix commit check
  • Loading branch information
ffromani authored Jun 4, 2024
2 parents 92c3bc7 + 61bbff4 commit 3b8d5b9
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions hack-kni/verify-commits.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
set -e -o pipefail

function finish {
if [ -f "$commit_msg_filename" ]; then
rm -f "$commit_msg_filename"
fi
if [ -f "$commit_msg_filename" ]; then
rm -f "$commit_msg_filename"
fi
}
trap finish EXIT

Expand All @@ -17,9 +17,9 @@ if [[ "$TRIGGER_BRANCH" == resync-* ]]; then
exit 0
fi

if (( $COMMITS <= 0 )); then
echo "WARN: no changes detected"
exit 0
if [ -z "$COMMITS" ] || (( $COMMITS <= 0 )); then
echo "WARN: no changes detected [COMMITS=${COMMITS}]"
exit 0
fi

echo "considering ${COMMITS} commits in PR whose head is $TRIGGER_BRANCH (into $UPSTREAM_BRANCH):"
Expand Down

0 comments on commit 3b8d5b9

Please sign in to comment.