Skip to content

Commit 44b9e76

Browse files
authored
feat: add custom install command parameter (#70)
For example when using Yarn v2 you could do ```yml - uses: bahmutov/npm-install@v1 with: install-command: yarn --immutable ```
1 parent 351d3b4 commit 44b9e76

File tree

8 files changed

+10914
-7080
lines changed

8 files changed

+10914
-7080
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
name: example-install-command
2+
on: [push, pull_request]
3+
jobs:
4+
test:
5+
runs-on: ubuntu-latest
6+
steps:
7+
- uses: actions/checkout@v2
8+
- uses: ./
9+
with:
10+
install-command: yarn --frozen-lockfile --silent
11+
working-directory: examples/yarn
12+
- run: npm t
13+
working-directory: examples/yarn

README.md

+12
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,18 @@ You can install just the production dependencies (without installing dev depende
117117
NODE_ENV: production
118118
```
119119

120+
### Custom install command
121+
122+
You can use your own install command
123+
124+
```yml
125+
- uses: bahmutov/npm-install@v1
126+
with:
127+
install-command: yarn --frozen-lockfile --silent
128+
```
129+
130+
See [example-install-command.yml](./.github/workflows/example-install-command.yml)
131+
120132
## NPM
121133

122134
If you are writing your own GitHub Action and would like to use this action as a utility function, import it and run it.

action.yml

+3
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,6 @@ inputs:
1515
useLockFile:
1616
description: 'Option to enable or disable use of a lock file (package-lock.json/yarn.lock)'
1717
required: false
18+
install-command:
19+
description: 'Custom install command to use'
20+
required: false

0 commit comments

Comments
 (0)