Skip to content

Commit

Permalink
fix: do not run npm --if-present build on npm cache hit (#1396)
Browse files Browse the repository at this point in the history
Fixes YAML variable interopolation.
  • Loading branch information
achingbrain authored Oct 26, 2023
1 parent d588c9e commit 7111f49
Showing 1 changed file with 3 additions and 3 deletions.
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

0 comments on commit 7111f49

Please sign in to comment.