File tree Expand file tree Collapse file tree 3 files changed +11
-3
lines changed
Expand file tree Collapse file tree 3 files changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -38,7 +38,7 @@ The inputs this action uses are:
3838| `NETLIFY_DEPLOY_MESSAGE` | `false` | '' | An optional deploy message |
3939| `build_directory` | `false` | `'build'` | The directory where your files are built |
4040| `functions_directory` | `false` | N/A | The (optional) directory where your Netlify functions are stored |
41- | `install_command` | `false` | `npm i` | The (optional) command to install dependencies |
41+ | `install_command` | `false` | Auto-detected | The (optional) command to install dependencies. Runs `yarn` when `yarn.lock` is found; `npm i` otherwise |
4242| `build_command` | `false` | `npm run build` | The (optional) command to build static website |
4343| `deploy_alias` | `false` | '' | (Optional) [Deployed site alias](https://cli.netlify.com/commands/deploy) |
4444
Original file line number Diff line number Diff line change @@ -36,7 +36,7 @@ inputs:
3636 install_command :
3737 description : ' Command to install dependencies'
3838 required : false
39- default : ' npm i '
39+ default : ' '
4040
4141 build_command :
4242 description : ' Command to build static website'
Original file line number Diff line number Diff line change @@ -12,7 +12,15 @@ BUILD_COMMAND=$7
1212DEPLOY_ALIAS=$8
1313
1414# Install dependencies
15- eval ${INSTALL_COMMAND:- " npm i" }
15+ if [[ -n $INSTALL_COMMAND ]]
16+ then
17+ eval $INSTALL_COMMAND
18+ elif [[ -f yarn.lock ]]
19+ then
20+ yarn
21+ else
22+ npm i
23+ fi
1624
1725# Build project
1826eval ${BUILD_COMMAND:- " npm run build" }
You can’t perform that action at this time.
0 commit comments