Skip to content

Commit

Permalink
Merge pull request #25861 from adamgrzybowski/@swm/look-for-patch-fil…
Browse files Browse the repository at this point in the history
…es-changes-in-set-up-node-gh-action

[NoQA] Look for patch files changes in set up node action
  • Loading branch information
mountiny authored Aug 25, 2023
2 parents dc70462 + a69dd9f commit 1958418
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions .github/actions/composite/setupNode/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,31 @@ runs:
path: desktop/node_modules
key: ${{ runner.os }}-desktop-node-modules-${{ hashFiles('desktop/package-lock.json') }}

- name: Check if patch files changed
id: patchCheck
shell: bash
run: |
set -e
if [[ `git diff main --name-only | grep \.patch` != null ]]; then
echo 'CHANGES_IN_PATCH_FILES=true' >> "$GITHUB_OUTPUT"
else
echo 'CHANGES_IN_PATCH_FILES=false' >> "$GITHUB_OUTPUT"
fi
- name: Patch root project node packages
shell: bash
if: |
steps.patchCheck.outputs.CHANGES_IN_PATCH_FILES == 'true' &&
steps.cache-node-modules.outputs.cache-hit == 'true'
run: npx patch-package

- name: Patch node packages for desktop submodule
shell: bash
if: |
steps.patchCheck.outputs.CHANGES_IN_PATCH_FILES == 'true' &&
steps.cache-desktop-node-modules.outputs.cache-hit == 'true'
run: cd desktop && npx patch-package

- name: Install root project node packages
if: steps.cache-node-modules.outputs.cache-hit != 'true'
uses: nick-fields/retry@v2
Expand Down

0 comments on commit 1958418

Please sign in to comment.