Skip to content

Commit

Permalink
fix(travis): validate TRAVIS_COMMIT if TRAVIS_PULL_REQUEST_SHA is not…
Browse files Browse the repository at this point in the history
… set. (#3094)

Looks like the pre-merge travis run sets TRAVIS_PULL_REQUEST_SHA but the post-merge run does not.
In the post-merge the TRAVIS_COMMIT should be the PR, so validate it.
  • Loading branch information
johnjbarton committed Jul 31, 2018
1 parent 56fda53 commit fba5d36
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions .travis.yml
Expand Up @@ -36,10 +36,11 @@ before_script:
- sh -e /etc/init.d/xvfb start
- npm run init
- export $(openssl aes-256-cbc -pass env:CREDENTIALS_PASS -d -in credentials)
- echo "git head commit $(git rev-parse FETCH_HEAD)"
- echo "TRAVIS_COMMIT $TRAVIS_COMMIT"
- echo "TRAVIS_PULL_REQUEST_SHA $TRAVIS_PULL_REQUEST_SHA"
- 'if [ "$VALIDATE_COMMIT_MSG" == "true" ]; then ./scripts/validate-commit-msg.sh $TRAVIS_PULL_REQUEST_SHA; fi'
- COMMIT_TO_VALIDATE=${TRAVIS_PULL_REQUEST_SHA:-TRAVIS_COMMIT}
- echo "COMMIT_TO_VALIDATE $COMMIT_TO_VALIDATE"
- 'if [ "$VALIDATE_COMMIT_MSG" == "true" ]; then ./scripts/validate-commit-msg.sh $COMMIT_TO_VALIDATE; fi'
- 'if [ "$LINT" == "true" ]; then npm run lint; fi'

script:
Expand Down

0 comments on commit fba5d36

Please sign in to comment.