pnpm / pnpm/action-setup

Cache across multiple jobs without deleting the dest folder

Open
#146 1 comment 6 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
1.3k
Forks
217
Avg merge
8h 42m
Merged PRs (30d)
1

Description

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

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading src/install-pnpm/run.ts at line 14, where the issue reports that the pnpm store directory is deleted. Trace how repeated action-setup runs handle an existing destination, then determine how a skip-if-already-installed option should behave across multiple jobs. Done means repeated setup does not remove the existing pnpm store while still ensuring pnpm is installed.

Written by the indexing model from the issue text.

Assessment

Tech stack
github-actions, typescript
Domain
ci-cd, tooling
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.