actions / cache

Cache dependencies and build outputs in GitHub Actions
MIT License
4.37k stars 1.16k forks source link

Cache restored successfully = sf: command not found #1295

Closed jonny-harte closed 6 months ago

jonny-harte commented 7 months ago

Hi, I'm trying to cache a global npm package but I get sf: command not found when the cache is restored. I've tried adding the path from which sf but that didn't help. What else do I need to add to the cache to make this work?

- name: Cache
      id: cache
      uses: actions/cache@v3
      with:
        path: |
          ~/.npm
          /usr/local/bin/sf
        key: Salesforce-CLI

- name: Install Salesforce CLI & Plugins
      if: steps.cache.outputs.cache-hit != 'true'
      shell: bash
      run: |
        npm install @salesforce/cli --global
        echo y | sf plugins install sfdx-git-delta