I have a setup job in my CI which installs all npm packages and stores them in cache:
setup:
stage: pre-build
cache:
untracked: true
when: on_success
key:
files:
- repo-hash
prefix: workspace
script:
- yarn install --frozen-lockfile
Currently, if the repo-hash does not change between two pipelines, the job successfully downloads the existing cache, but it still runs yarn install --frozen-lockfile.
How to change this behaviour, so that if the cache exists, this job is skipped?