2017-03-07 04:39:37 -05:00
|
|
|
#!/bin/bash
|
|
|
|
set -eux -o pipefail
|
|
|
|
|
|
|
|
# Set up env
|
2017-05-12 04:15:08 -04:00
|
|
|
source "`dirname $0`/_env.sh"
|
2017-03-07 04:39:37 -05:00
|
|
|
|
2017-05-12 04:08:45 -04:00
|
|
|
# Build `scripts-js/`
|
2017-05-12 15:07:51 -04:00
|
|
|
(
|
|
|
|
cd "$SCRIPTS_JS_DIR"
|
|
|
|
yarn install
|
|
|
|
yarn build
|
|
|
|
)
|
2017-05-12 04:08:45 -04:00
|
|
|
|
2017-03-07 04:39:37 -05:00
|
|
|
# Preverify PR
|
|
|
|
AIO_GITHUB_ORGANIZATION="angular" \
|
2017-03-13 14:34:53 -04:00
|
|
|
AIO_GITHUB_TEAM_SLUGS="angular-core,aio-contributors" \
|
2017-03-07 04:39:37 -05:00
|
|
|
AIO_GITHUB_TOKEN=$(echo ${GITHUB_TEAM_MEMBERSHIP_CHECK_KEY} | rev) \
|
|
|
|
AIO_REPO_SLUG=$TRAVIS_REPO_SLUG \
|
2017-06-18 18:15:07 -04:00
|
|
|
AIO_TRUSTED_PR_LABEL="aio: preview" \
|
2017-03-07 04:39:37 -05:00
|
|
|
AIO_PREVERIFY_PR=$TRAVIS_PULL_REQUEST \
|
|
|
|
node "$SCRIPTS_JS_DIR/dist/lib/upload-server/index-preverify-pr"
|
2017-06-18 18:15:07 -04:00
|
|
|
|
|
|
|
# Exit codes:
|
|
|
|
# - 0: The PR can be automatically trusted (i.e. author belongs to trusted team or PR has the "trusted PR" label).
|
|
|
|
# - 1: An error occurred.
|
|
|
|
# - 2: The PR cannot be automatically trusted.
|