mirror of
https://github.com/hasura/graphql-engine.git
synced 2024-12-15 09:22:43 +03:00
update ciignore to take circleci compare url (#158)
This commit is contained in:
parent
92935bed40
commit
3cb62622b2
@ -14,9 +14,20 @@ if [[ ! -a "$ROOT/.ciignore" ]]; then
|
||||
exit # If .ciignore doesn't exists, just quit this script
|
||||
fi
|
||||
|
||||
changes="$(git diff-tree --no-commit-id --name-only -r origin/master..HEAD)"
|
||||
# If branch is master, diff with origin/master will always be empty. Depend on
|
||||
# CIRCLE_COMPARE_URL first and if its not set, check for diff with master.
|
||||
if [[ ! -z "$CIRCLE_COMPARE_URL" ]]; then
|
||||
# CIRCLE_COMPARE_URL is not empty, use it to get the diff
|
||||
COMMIT_RANGE=$(echo $CIRCLE_COMPARE_URL | sed 's:^.*/compare/::g')
|
||||
echo "Diff: $COMMIT_RANGE"
|
||||
changes="$(git diff $COMMIT_RANGE --name-only)"
|
||||
else
|
||||
# CIRCLE_COMPARE_URL is not set, diff with origin/master
|
||||
echo "Diff: origin/master..HEAD"
|
||||
changes="$(git diff-tree --no-commit-id --name-only -r origin/master..HEAD)"
|
||||
fi
|
||||
|
||||
echo "CHANGES FROM ORIGIN/MASTER:"
|
||||
echo "Changes in this build:"
|
||||
echo $changes
|
||||
echo
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user