Skip to content

Commit

Permalink
chore: solidify lint-prcommits
Browse files Browse the repository at this point in the history
  • Loading branch information
marionebl committed May 3, 2017
1 parent 627b3f3 commit ac820c8
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions scripts/lint-prcommits.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,20 @@ set -e
set -u

# Add the clone as remote if this is a PR from a clone
if [ $TRAVIS_PULL_REQUEST_SLUG != "" ] && [ $TRAVIS_PULL_REQUEST_SLUG != $TRAVIS_REPO_SLUG ]; then
if [[ $TRAVIS_PULL_REQUEST_SLUG != "" && $TRAVIS_PULL_REQUEST_SLUG != $TRAVIS_REPO_SLUG ]]; then
git remote add "$TRAVIS_PULL_REQUEST_SLUG" "https://github.com/$TRAVIS_PULL_REQUEST_SLUG.git"
git fetch "$TRAVIS_PULL_REQUEST_SLUG"
fi

# Use REMOTE/BRANCH as comparison if applicable
if [ $TRAVIS_PULL_REQUEST_SLUG != "" ]; then
if [[ $TRAVIS_PULL_REQUEST_SLUG != "" ]]; then
TO="$TRAVIS_PULL_REQUEST_SLUG/$TRAVIS_PULL_REQUEST_BRANCH"
else
TO="$TRAVIS_PULL_REQUEST_BRANCH"
fi

conventional-changelog-lint --from="$TRAVIS_BRANCH" --to="$TO"
if [[ $TRAVIS_BRANCH == $TO ]]; then
conventional-changelog-lint --from="HEAD~1"
else
conventional-changelog-lint --from="$TRAVIS_BRANCH" --to="$TO"
fi

0 comments on commit ac820c8

Please sign in to comment.