Skip to content

Commit 7a23dec

Browse files
committed
test(patches): if yarn install fails (e.g., a new package) skip it gracefully
previously if you made an entirely new package, patch generation would fail completely until it was formally released and available for `yarn add`
1 parent 2fcf9f7 commit 7a23dec

File tree

1 file changed

+12
-10
lines changed

1 file changed

+12
-10
lines changed

.github/workflows/create_test_patches.yml

+12-10
Original file line numberDiff line numberDiff line change
@@ -78,14 +78,16 @@ jobs:
7878
mkdir patches || true
7979
for PACKAGE in $PACKAGE_LIST; do
8080
echo "Installing package $PACKAGE into fresh template app, then clobbering with PR version"
81-
yarn add @react-native-firebase/$PACKAGE
82-
pushd node_modules/@react-native-firebase
83-
tar -zxf $HOME/packages/react-native-firebase-${PACKAGE}-v*
84-
mv $PACKAGE/package.json package/
85-
\rm -fr $PACKAGE
86-
mv package $PACKAGE
87-
popd
88-
npx patch-package @react-native-firebase/$PACKAGE || true
81+
yarn add @react-native-firebase/$PACKAGE || true
82+
if [ -d node_modules/@react-native-firebase/$PACKAGE ]; then
83+
pushd node_modules/@react-native-firebase
84+
tar -zxf $HOME/packages/react-native-firebase-${PACKAGE}-v*
85+
mv $PACKAGE/package.json package/
86+
\rm -fr $PACKAGE
87+
mv package $PACKAGE
88+
popd
89+
npx patch-package @react-native-firebase/$PACKAGE || true
90+
fi
8991
done
9092
ls -la $HOME/template/patches
9193
shell: bash
@@ -95,9 +97,9 @@ jobs:
9597
with:
9698
name: patches
9799
path: ~/template/patches/
98-
100+
99101
# create a comment on the PR and any related issues with a direct link to the archive,
100-
# a call for testers, and perhaps a paste-able set of commands to install them
102+
# a call for testers, and perhaps a paste-able set of commands to install them
101103
# (mkdir patches, curl -o etc, npx patch-package)
102104
# You need an artifact id to get a download link for it.
103105
# You need a workflow run id to get an artifact id.

0 commit comments

Comments
 (0)