2018-03-17 02:48:36 +03:00
|
|
|
#!/bin/bash
|
2018-09-12 01:27:47 +03:00
|
|
|
# Copyright (c) Facebook, Inc. and its affiliates.
|
2018-09-07 23:08:05 +03:00
|
|
|
#
|
|
|
|
# This source code is licensed under the MIT license found in the
|
|
|
|
# LICENSE file in the root directory of this source tree.
|
2018-03-17 02:48:36 +03:00
|
|
|
|
2019-05-22 05:35:40 +03:00
|
|
|
GITHUB_OWNER=${CIRCLE_PROJECT_USERNAME:-facebook}
|
|
|
|
GITHUB_REPO=${CIRCLE_PROJECT_REPONAME:-react-native}
|
|
|
|
export GITHUB_OWNER
|
|
|
|
export GITHUB_REPO
|
|
|
|
|
|
|
|
cat <(echo eslint; npm run lint --silent -- --format=json; echo flow; npm run flow-check-ios --silent --json; echo flow; npm run flow-check-android --silent --json) | GITHUB_PR_NUMBER="$CIRCLE_PR_NUMBER" node bots/code-analysis-bot.js
|
2018-03-17 02:48:36 +03:00
|
|
|
|
|
|
|
STATUS=$?
|
|
|
|
if [ $STATUS == 0 ]; then
|
2018-10-05 21:26:14 +03:00
|
|
|
echo "Code analyzed successfully."
|
2018-03-17 02:48:36 +03:00
|
|
|
else
|
2018-10-05 21:26:14 +03:00
|
|
|
echo "Code analysis failed, error status $STATUS."
|
2018-03-17 02:48:36 +03:00
|
|
|
fi
|