From 1908d50ba4052cea0be92a0fee272ca256c38c22 Mon Sep 17 00:00:00 2001 From: Tommy Nguyen Date: Wed, 15 Apr 2020 11:43:23 -0700 Subject: [PATCH] Fix CIRCLE_PR_NUMBER may not always be set (#28640) Summary: This fixes build failures where `CIRCLE_PR_NUMBER` is not set. This can happen if the PR did not come from a fork. ## Changelog [Internal] [Fixed] - Fix CIRCLE_PR_NUMBER may not always be set Pull Request resolved: https://github.com/facebook/react-native/pull/28640 Test Plan: Report bundle size step should pass on both this PR and https://github.com/facebook/react-native/issues/28641. Reviewed By: cpojer Differential Revision: D21045553 Pulled By: TheSavior fbshipit-source-id: fdfcb1bb88a96345b78ca69c49623df71d4cd608 --- scripts/circleci/report-bundle-size.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/circleci/report-bundle-size.sh b/scripts/circleci/report-bundle-size.sh index 4f8c49535f7..c8fa6107938 100755 --- a/scripts/circleci/report-bundle-size.sh +++ b/scripts/circleci/report-bundle-size.sh @@ -8,7 +8,7 @@ case $1 in "android" | "ios") GITHUB_OWNER=${CIRCLE_PROJECT_USERNAME:-facebook} \ GITHUB_REPO=${CIRCLE_PROJECT_REPONAME:-react-native} \ - GITHUB_PR_NUMBER="$CIRCLE_PR_NUMBER" \ + GITHUB_PR_NUMBER="${CIRCLE_PR_NUMBER:-${CIRCLE_PULL_REQUEST##*/}}" \ GITHUB_REF=${CIRCLE_BRANCH} \ GITHUB_SHA=${CIRCLE_SHA1} \ node bots/report-bundle-size.js "$1"