tespkg / actions-cache

Cache to S3 storage with official actions/cache@v2 fallback
MIT License
75 stars 31 forks source link

💡 - can I use `\n` in the `path` parameter? #46

Open eliotik opened 3 months ago

eliotik commented 3 months ago

Is your feature request related to a problem? Please describe.

No

Describe the solution you'd like

N/A

Describe alternatives you've considered

N/A

Additional context

I pass to the action as a value for path as following:

        path: |
          ${{ steps.detect-package-manager.outputs.cache-path }}

where steps.detect-package-manager.outputs.cache-path value is node_modules\n!node_modules/.cache will it actually work? Value determined automatically in a detect-package-manager step. Depending on a repository we have different package managers. Result of interpolation:

        path: |
          node_modules\n!node_modules/.cache

or should it be

        path: |
          node_modules
          !node_modules/.cache
eliotik commented 3 months ago

Based on this https://github.com/tespkg/actions-cache/blob/main/src/utils.ts#L63 looks like i can simply do:

        path: "node_modules\n!node_modules/.cache"
eliotik commented 3 months ago

Looks like it doesn't work, from debug log of workflow execution:

##[debug]Search path '/home/runner/work/hub-api/hub-api/node_modulesn!node_modules/.cache'
##[debug]Cache Paths:
##[debug][]