fix: do not run npm --if-present build
on npm cache hit
#1396
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes a regression introduced by #1070.
Essentially you can't include
${{ ... }}
inside regular YAMLif
clauses, you have to have the whole clause inside${{ ... }}
.This explains why every monorepo job builds on every run despite the npm/build cache being hit.
For the situation where the build cache exists (run GH action with debug logging turned on to see this sort of thing):
Before:
Essentially it's evaluating
(true && 'steps.cache.outputs.cache-hit != ''true'' && true == ''true''')
, e.g.(true && string)
which always evaluates totrue
.After: