Skip to content
This repository has been archived by the owner on Nov 18, 2024. It is now read-only.

Add option to make npm install optional #5

Merged
merged 5 commits into from
Jul 3, 2020
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ You provide configuration properties within your workflow by using the `with` pr
| useEslintrc | boolean | true | false | Use eslintrc? |
| useEslintIgnore | boolean | true | false | Use eslintignore? |
| fix | boolean | false | false | Commit fixes when possible (UNFINISHED) |
| npmInstall | boolean | true | false | Runs `npm install` for you |

> The official settings can always be seen by viewing the [`action.yml`](https://github.com/bradennapier/eslint-plus-action/blob/master/action.yml) schema for the action.

Expand Down Expand Up @@ -126,6 +127,24 @@ jobs:
reportIgnoredFiles: true
```

### With a manual `npm install` step

```yml
jobs:
eslint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install dependencies
run: npm ci
- name: Run a build step
run: npm run build
- uses: bradennapier/eslint-plus-action@v2
with:
github-token: ${{secrets.GITHUB_TOKEN}}
npmInstall: false
```

## More Previews

<p align="center">
Expand Down
5 changes: 5 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,13 @@ inputs:
fix:
description: 'Run with --fix? Defaults to false'
required: false
npmInstall:
description: 'Run npm install (or yarn) for you. If you do not use this option, do the npm install step yourself, before running this action. Defaults to true'
luisherranz marked this conversation as resolved.
Show resolved Hide resolved
required: false
default: true
luisherranz marked this conversation as resolved.
Show resolved Hide resolved
runs:
using: docker
image: Dockerfile
args:
- "${{ inputs.github-token }}"
- "${{ inputs.npmInstall }}"
8 changes: 5 additions & 3 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,11 @@ set -e

echo "First Install";
ls -alh
echo "Install Yarn"
[ -f yarn.lock ] && yarn install --frozen-lockfile --prefer-offline
[ -f package-lock.json ] && npm install
if [ "$2" = true ] ; then
luisherranz marked this conversation as resolved.
Show resolved Hide resolved
echo "Install Yarn"
[ -f yarn.lock ] && yarn install --frozen-lockfile --prefer-offline
[ -f package-lock.json ] && npm install
luisherranz marked this conversation as resolved.
Show resolved Hide resolved
fi

pushd /action
echo "Yarn Action Install"
Expand Down