Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: do not run npm --if-present build on npm cache hit #1396

Merged
merged 1 commit into from
Oct 26, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions actions/cache-node-modules/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ inputs:
default: 'echo'
build_on_cache_fail:
description: 'Whether you want to run `npm run --if-present build` if there is no cache'
require: false
required: false
default: 'true' # defaulting to true to not break any existing users.
cache_name:
description: 'Cache name'
Expand Down Expand Up @@ -38,9 +38,9 @@ runs:
- if: steps.cache.outputs.cache-hit != 'true'
run: npm install
shell: bash
- if: steps.cache.outputs.cache-hit != 'true' && ${{ inputs.build_on_cache_fail }} == 'true'
- if: ${{ steps.cache.outputs.cache-hit != 'true' && inputs.build_on_cache_fail == 'true' }}
run: npm run --if-present build
shell: bash
- if: steps.cache.outputs.cache-hit != 'true' && ${{ inputs.build }} != 'echo'
- if: ${{ steps.cache.outputs.cache-hit != 'true' && inputs.build != 'echo' }}
run: ${{ inputs.build }}
shell: bash