From 1873e022cc396229143d1637711d244c35e557b2 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Evrard Date: Wed, 3 Mar 2021 10:49:22 +0100 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 d575e858..1099f5ff 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'