-
-
Notifications
You must be signed in to change notification settings - Fork 197
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Morten Henriksen
committed
Nov 28, 2017
1 parent
db95bf9
commit 777b891
Showing
4 changed files
with
315 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#!/bin/bash | ||
set -e | ||
set -u | ||
|
||
if [[ $TRAVIS_PULL_REQUEST_SLUG != "" && $TRAVIS_PULL_REQUEST_SLUG != $TRAVIS_REPO_SLUG ]]; then | ||
# This is a Pull Request from a different slug, hence a forked repository | ||
git remote add "$TRAVIS_PULL_REQUEST_SLUG" "https://github.com/$TRAVIS_PULL_REQUEST_SLUG.git" | ||
git fetch "$TRAVIS_PULL_REQUEST_SLUG" | ||
|
||
# Use the fetched remote pointing to the source clone for comparison | ||
TO="$TRAVIS_PULL_REQUEST_SLUG/$TRAVIS_PULL_REQUEST_BRANCH" | ||
else | ||
# This is a Pull Request from the same remote, no clone repository | ||
TO=$TRAVIS_COMMIT | ||
fi | ||
|
||
# Lint all commits in the PR | ||
# - Covers fork pull requests (when TO=slug/branch) | ||
# - Covers branch pull requests (when TO=branch) | ||
./node_modules/.bin/commitlint --from="$TRAVIS_BRANCH" --to="$TO" | ||
|
||
# Always lint the triggerig commit | ||
# - Covers direct commits | ||
./node_modules/.bin/commitlint --from="$TRAVIS_COMMIT" | ||
H |
Oops, something went wrong.