mirror of
https://github.com/actions/setup-node
synced 2024-11-09 15:12:40 +00:00
Apply suggestions from code review
Co-authored-by: Alena Sviridenko <alenasviridenko@github.com>
This commit is contained in:
parent
d9aab2aba4
commit
5aa72c249a
1 changed files with 4 additions and 4 deletions
|
@ -8,7 +8,7 @@ Currently, `actions/setup-node` supports caching dependencies for Npm and Yarn p
|
||||||
For the first iteration, we have decided to not support cases where `package-lock.json` / `yarn.lock` are located outside of repository root.
|
For the first iteration, we have decided to not support cases where `package-lock.json` / `yarn.lock` are located outside of repository root.
|
||||||
Current implementation searches the following file patterns in the repository root: `package-lock.json`, `yarn.lock` (in order of resolving priorities)
|
Current implementation searches the following file patterns in the repository root: `package-lock.json`, `yarn.lock` (in order of resolving priorities)
|
||||||
|
|
||||||
Obviosly, it made build-in caching unusable for mono-repos and repos with complex structure.
|
Obviously, it made build-in caching unusable for mono-repos and repos with complex structure.
|
||||||
We would like to revisit this decision and add customization for dependencies lock file location.
|
We would like to revisit this decision and add customization for dependencies lock file location.
|
||||||
|
|
||||||
## Proposal
|
## Proposal
|
||||||
|
@ -24,8 +24,8 @@ The second option looks more generic because it allows to:
|
||||||
## Decision
|
## Decision
|
||||||
|
|
||||||
Add `deps-lock-file` input that will accept path (relative to repository root) to dependencies lock file.
|
Add `deps-lock-file` input that will accept path (relative to repository root) to dependencies lock file.
|
||||||
If path provided path contains wildcards, the action will search all maching files and calculate common hash like `${{ hashFiles('**/packages.lock.json') }}` YAML construction does.
|
If provided path contains wildcards, the action will search all maching files and calculate common hash like `${{ hashFiles('**/packages.lock.json') }}` YAML construction does.
|
||||||
The hash of privided matched files will be used as a part of cache key.
|
The hash of provided matched files will be used as a part of cache key.
|
||||||
|
|
||||||
Yaml examples:
|
Yaml examples:
|
||||||
```yml
|
```yml
|
||||||
|
@ -45,4 +45,4 @@ steps:
|
||||||
node-version: 14
|
node-version: 14
|
||||||
cache: yarn
|
cache: yarn
|
||||||
deps-lock-file: 'sub-project/**/yarn.lock'
|
deps-lock-file: 'sub-project/**/yarn.lock'
|
||||||
```
|
```
|
||||||
|
|
Loading…
Reference in a new issue