summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRich Trott <rtrott@gmail.com>2018-10-17 19:17:06 -0700
committerJames M Snell <jasnell@gmail.com>2018-10-21 12:25:07 -0700
commit40280e62a30399469b93bf5a5eb78f9a1e1bae62 (patch)
treee33a379fbbb2f9efa79a95e00b14c1035137157e
parent77b3666b84f7aa5d264e5232b39ee6f9f99d1cfc (diff)
downloadnode-new-40280e62a30399469b93bf5a5eb78f9a1e1bae62.tar.gz
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 PR-URL: https://github.com/nodejs/node/pull/23725 Reviewed-By: Anatoli Papirovski <apapirovski@mac.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Matheus Marchini <mat@mmarchini.me>
-rw-r--r--.travis.yml2
1 files changed, 1 insertions, 1 deletions
diff --git a/.travis.yml b/.travis.yml
index fad2e7f0c7..156d28298b 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