2017-03-07 11:39:37 +02:00
|
|
|
#!/bin/bash
|
|
|
|
set -eux -o pipefail
|
|
|
|
|
|
|
|
# Set up env
|
2017-05-12 11:15:08 +03:00
|
|
|
source "`dirname $0`/_env.sh"
|
2017-03-07 11:39:37 +02:00
|
|
|
|
2017-05-12 11:08:45 +03:00
|
|
|
# Build `scripts-js/`
|
2017-05-12 22:07:51 +03:00
|
|
|
(
|
|
|
|
cd "$SCRIPTS_JS_DIR"
|
|
|
|
yarn install
|
|
|
|
yarn build
|
|
|
|
)
|
2017-05-12 11:08:45 +03:00
|
|
|
|
2017-03-07 11:39:37 +02:00
|
|
|
# Preverify PR
|
|
|
|
AIO_GITHUB_ORGANIZATION="angular" \
|
2017-03-13 20:34:53 +02:00
|
|
|
AIO_GITHUB_TEAM_SLUGS="angular-core,aio-contributors" \
|
2017-03-07 11:39:37 +02:00
|
|
|
AIO_GITHUB_TOKEN=$(echo ${GITHUB_TEAM_MEMBERSHIP_CHECK_KEY} | rev) \
|
|
|
|
AIO_REPO_SLUG=$TRAVIS_REPO_SLUG \
|
2017-06-19 01:15:07 +03:00
|
|
|
AIO_TRUSTED_PR_LABEL="aio: preview" \
|
2017-03-07 11:39:37 +02:00
|
|
|
AIO_PREVERIFY_PR=$TRAVIS_PULL_REQUEST \
|
|
|
|
node "$SCRIPTS_JS_DIR/dist/lib/upload-server/index-preverify-pr"
|
2017-06-19 01:15:07 +03: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.
|