Skip to content

Commit 431ee47

Browse files
hramosmacdoum1
authored andcommitted
Skip metro bump commits (facebook#19680)
Summary: New metro releases are published to npm when a "Bump metro" commit is synced to GitHub and picked up by facebook/metro's Circle CI. The same commit is picked up by facebook/react-native's Circle CI, but it will fail the checkout job because yarn will not find the new package on npm. This is expected because the package will only be published to npm after Circle CI is done running on facebook/metro. We can safely skip `yarn install` on these commits, and rely on the restored yarn cache instead. Closes facebook#19680 Differential Revision: D8450638 Pulled By: hramos fbshipit-source-id: 436c229d09bfb4f9f92236c5aeec4a60d8317922
1 parent 255698f commit 431ee47

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

.circleci/config.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,8 +122,13 @@ aliases:
122122
command: source scripts/android-setup.sh && getAndroidNDK
123123

124124
- &yarn
125-
|
126-
yarn install --non-interactive --cache-folder ~/.cache/yarn
125+
name: Run Yarn
126+
command: |
127+
# Skip yarn install on metro bump commits as the package is not yet
128+
# available on npm
129+
if [[ $(echo "$GIT_COMMIT_DESC" | grep -c "Bump metro@") -eq 0 ]]; then
130+
yarn install --non-interactive --cache-folder ~/.cache/yarn
131+
fi
127132
128133
- &install-yarn
129134
name: Install Yarn
@@ -304,6 +309,8 @@ aliases:
304309

305310
defaults: &defaults
306311
working_directory: ~/react-native
312+
environment:
313+
- GIT_COMMIT_DESC: git log --format=oneline -n 1 $CIRCLE_SHA1
307314

308315
js_defaults: &js_defaults
309316
<<: *defaults

0 commit comments

Comments
 (0)