bahmutov / npm-install

GitHub Action for install npm dependencies with caching without any configuration
https://github.com/marketplace/actions/npm-or-yarn-install-with-caching
650 stars 70 forks source link

feat: add custom cache prefix #218

Closed bahmutov closed 7 months ago

bahmutov commented 7 months ago

Add cache prefix

If you are installing different individual tools, you might want to have different caches. You can insert custom cache prefix strings into the cache keys. For example, let's install two different tools, each cache will be separate.

- name: Install tool A
  uses: bahmutov/npm-install@v1
  with:
    # use just package.json checksum
    useLockFile: false
    install-command: 'npm install tool-a'
    cache-key-prefix: tool-a

- name: Install tool B
  uses: bahmutov/npm-install@v1
  with:
    # use just package.json checksum
    useLockFile: false
    install-command: 'npm install tool-b'
    cache-key-prefix: tool-b

The first cache will have key npm-tool-a-... and the second cache will have key npm-tool-b-...

github-actions[bot] commented 7 months ago

:tada: This PR is included in version 1.10.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket: