mirror of
https://github.com/danbulant/discord.js
synced 2026-06-09 01:31:29 +00:00
run builds for prs without commiting (#1997)
This commit is contained in:
parent
b8c70e7935
commit
abe98f716b
1 changed files with 10 additions and 7 deletions
|
|
@ -8,14 +8,13 @@ if [[ "$TRAVIS_BRANCH" == revert-* ]]; then
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# For PRs, do nothing
|
DONT_COMMIT=false
|
||||||
if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then
|
|
||||||
echo -e "\e[36m\e[1mBuild triggered for PR #${TRAVIS_PULL_REQUEST} to branch \"${TRAVIS_BRANCH}\" - doing nothing."
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Figure out the source of the build
|
if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then
|
||||||
if [ -n "$TRAVIS_TAG" ]; then
|
echo -e "\e[36m\e[1mBuild triggered for PR #${TRAVIS_PULL_REQUEST} to branch \"${TRAVIS_BRANCH}\" - not commiting"
|
||||||
|
SOURCE_TYPE="pr"
|
||||||
|
DONT_COMMIT=true
|
||||||
|
elif [ -n "$TRAVIS_TAG" ]; then
|
||||||
echo -e "\e[36m\e[1mBuild triggered for tag \"${TRAVIS_TAG}\"."
|
echo -e "\e[36m\e[1mBuild triggered for tag \"${TRAVIS_TAG}\"."
|
||||||
SOURCE=$TRAVIS_TAG
|
SOURCE=$TRAVIS_TAG
|
||||||
SOURCE_TYPE="tag"
|
SOURCE_TYPE="tag"
|
||||||
|
|
@ -35,6 +34,9 @@ fi
|
||||||
npm run docs
|
npm run docs
|
||||||
VERSIONED=false npm run webpack
|
VERSIONED=false npm run webpack
|
||||||
|
|
||||||
|
if [ $DONT_COMMIT ]; then
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
# Initialise some useful variables
|
# Initialise some useful variables
|
||||||
REPO=`git config remote.origin.url`
|
REPO=`git config remote.origin.url`
|
||||||
|
|
@ -85,3 +87,4 @@ git config user.name "Travis CI"
|
||||||
git config user.email "$COMMIT_AUTHOR_EMAIL"
|
git config user.email "$COMMIT_AUTHOR_EMAIL"
|
||||||
git commit -m "Webpack build for ${SOURCE_TYPE} ${SOURCE}: ${SHA}" || true
|
git commit -m "Webpack build for ${SOURCE_TYPE} ${SOURCE}: ${SHA}" || true
|
||||||
git push $SSH_REPO $TARGET_BRANCH
|
git push $SSH_REPO $TARGET_BRANCH
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue