action-setup icon indicating copy to clipboard operation
action-setup copied to clipboard

Cache across multiple jobs without deleting the dest folder

Open jlovell25 opened this issue 1 year ago • 1 comments

If I have a workflow that contains multiple pnpm jobs is there an easy way to have pnpm/action-setup in each so that is doesn't delete the dest folder each time it runs (when cached)? I'd like to keep the action in all jobs just to make sure pnpm is installed but the following line of code seems to delete the entire pnpm store directory each time it runs:

https://github.com/pnpm/action-setup/blob/ac5bf11548bf5e19b8aadb8182072616590fa4a6/src/install-pnpm/run.ts#L14

Would an option to skip if already installed be worth having?

Thanks

jlovell25 avatar Oct 21 '24 17:10 jlovell25

I was wondering the same. In my case, I'm using setup this action on self hosted runner with two separate runners (just setup runner twice in different location). When two jobs that use pnpm action runs in parallel, often one's rm line makes the other fail 🥲

enkhjile avatar Jan 02 '25 12:01 enkhjile