Skip to content

Commit

Permalink
update condition to run npm ci (#3139)
Browse files Browse the repository at this point in the history
  • Loading branch information
ZheSun88 committed Jan 10, 2025
1 parent 9487aaf commit f86006b
Showing 1 changed file with 25 additions and 2 deletions.
27 changes: 25 additions & 2 deletions .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,30 @@ runs:
node_modules
packages/ts/*/node_modules
key: ${{ runner.os }}-node_modules-${{ hashFiles('package-lock.json') }}
- name: Install npm dependencies
if: ${{ steps.cache-node_modules.outputs.cache-hit != 'true' }}
- name: Get all changed package*.json files
id: changed-package-json-files
uses: tj-actions/changed-files@v45
with:
files: |
package.json
packages/ts/*/package.json
- name: List all changed json files
if: steps.changed-package-json-files.outputs.any_changed == 'true'
env:
ALL_CHANGED_FILES: ${{ steps.changed-package-json-files.outputs.all_changed_files }}
shell: bash
run: |
for file in ${ALL_CHANGED_FILES}; do
echo "$file was changed"
done
- name: Install npm dependencies when no changes on package json
if: ${{ steps.cache-node_modules.outputs.cache-hit != 'true' && steps.changed-package-json-files.outputs.any_changed != 'true' }}
shell: bash
run: npm ci

- name: Install npm dependencies when there are changes on package json
if: ${{ steps.changed-package-json-files.outputs.any_changed == 'true' }}
shell: bash
run: npm install

0 comments on commit f86006b

Please sign in to comment.