Skip to content

Commit de2b97b

Browse files
committed
chore: add condition to install again
1 parent 64fa7c2 commit de2b97b

File tree

1 file changed

+14
-8
lines changed

1 file changed

+14
-8
lines changed

.github/workflows/comment-diffs.yml

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ on:
88
- '.github/workflows/comment-diffs.yml'
99
- 'packages/create-react-native-library/**'
1010
- '!**.md'
11-
permissions: write-all
1211

1312
jobs:
1413
generate-diffs-if-needed:
@@ -31,9 +30,14 @@ jobs:
3130
- name: 📥 Monorepo install
3231
uses: ./.github/actions/setup
3332
with:
34-
enable-corepack: false
33+
cache-npm-cache: true
3534
cache-node-modules: true
3635
cache-install-state: true
36+
37+
- name: Get hash of yarn lock
38+
id: yarn-lock-hash
39+
run: |
40+
echo "YARN_LOCK_HASH=${{ hashFiles('./yarn.lock') }}" >> $GITHUB_OUTPUT
3741
3842
- name: Build crnl
3943
run: |
@@ -77,8 +81,13 @@ jobs:
7781
done
7882
done
7983
80-
# - name: Setup again # Add a check here to setup again if deps changed
81-
# uses: ./.github/actions/setup
84+
- name: Setup again #
85+
if: ${{ steps.yarn-lock-hash.outputs.YARN_LOCK_HASH != hashFiles('./yarn.lock') }}
86+
uses: ./.github/actions/setup
87+
with:
88+
cache-npm-cache: true
89+
cache-node-modules: true
90+
cache-install-state: true
8291

8392
- name: Remove old build and build again
8493
run: |
@@ -128,10 +137,7 @@ jobs:
128137
done
129138
130139
- name: Remove everything
131-
run: |
132-
# Remove everything except the .git folder
133-
for i in $(ls | grep -v ".git") ; do rm -rf "$i"; done;
134-
rm -rf ./.git
140+
run: for i in $(ls) ; do rm -rf "$i"; done;
135141

136142
- name: Checkout
137143
# uses: checkout

0 commit comments

Comments
 (0)