From e5a53b9915ab6234f1d4b16b1e8df9a73989b225 Mon Sep 17 00:00:00 2001 From: LuausDalmolin Date: Tue, 25 Jul 2023 15:14:48 +0800 Subject: [PATCH] test: Add guard when no commit needs testing Without this patch, github actions fail. It's a temporary workaround until [1] is done. [1]: https://github.com/purpleidea/mgmt/issues/643 --- test/test-commit-message.sh | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/test/test-commit-message.sh b/test/test-commit-message.sh index d575e85..1099f5f 100755 --- a/test/test-commit-message.sh +++ b/test/test-commit-message.sh @@ -134,12 +134,12 @@ then head="" fi commits=$(git log --no-merges --format=%H origin/${ref}..${head}) - [[ -n "$commits" ]] - - for commit in $commits - do - test_commit_message $commit - test_commit_message_common_bugs $commit - done + if [[ -n "$commits" ]]; then + for commit in $commits + do + test_commit_message $commit + test_commit_message_common_bugs $commit + done + fi fi echo 'PASS'