From 83628a48b5e0be3b992a89333999b5ee174a75c4 Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Wed, 17 Oct 2018 19:17:06 -0700 Subject: [PATCH] tools: do not lint commit message if var undefined Check that $TRAVIS_COMMIT_RANGE is set before trying to lint commit messages in Travis CI. Refs: https://github.com/nodejs/node/pull/23572#issuecomment-430850382 Refs: https://github.com/nodejs/node/pull/22842#issuecomment-430850049 --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index fad2e7f0c77509..156d28298b4e58 100644 --- a/.travis.yml +++ b/.travis.yml @@ -13,7 +13,7 @@ matrix: script: - make lint # Lint the first commit in the PR. - - git log $TRAVIS_COMMIT_RANGE --pretty=format:'%h' --no-merges | tail -1 | xargs npx core-validate-commit --no-validate-metadata + - \[ -z "$TRAVIS_COMMIT_RANGE" \] || git log $TRAVIS_COMMIT_RANGE --pretty=format:'%h' --no-merges | tail -1 | xargs npx core-validate-commit --no-validate-metadata - name: "Test Suite" install: - ./configure