Skip to content

Commit 22043cc

Browse files
Trottrvagg
authored andcommitted
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: #23572 (comment) Refs: #22842 (comment) PR-URL: #23725 Reviewed-By: Anatoli Papirovski <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Matheus Marchini <[email protected]>
1 parent 2a8a28c commit 22043cc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

.travis.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ matrix:
1313
script:
1414
- make lint
1515
# Lint the first commit in the PR.
16-
- git log $TRAVIS_COMMIT_RANGE --pretty=format:'%h' --no-merges | tail -1 | xargs npx core-validate-commit --no-validate-metadata
16+
- \[ -z "$TRAVIS_COMMIT_RANGE" \] || git log $TRAVIS_COMMIT_RANGE --pretty=format:'%h' --no-merges | tail -1 | xargs npx core-validate-commit --no-validate-metadata
1717
- name: "Test Suite"
1818
install:
1919
- ./configure

0 commit comments

Comments
 (0)