Skip to content

Commit cb18cda

Browse files
committed
Update usage to the new API
1 parent be57eb9 commit cb18cda

File tree

1 file changed

+16
-33
lines changed

1 file changed

+16
-33
lines changed

README.md

Lines changed: 16 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -12,36 +12,25 @@ More info [on the ESLint getting started guide](https://eslint.org/docs/user-gui
1212

1313
### main.workflow
1414

15-
Add any of the examples below to your workflow file in `.github/main.workflow`
15+
Add any of the examples below to your workflow file in `.github/workflow/lint.yml`
1616

1717
This is the simplest example to get it running:
1818
```
19-
workflow "New workflow" {
20-
on = "push"
21-
resolves = ["ESLint"]
22-
}
23-
24-
action "ESLint" {
25-
uses = "stefanoeb/eslint-action@master"
26-
}
27-
```
19+
name: Lint
2820
29-
By default it will run ESLint through all the files in the project. But you can also specify a glob of files on the `args`, just like ESLint:
30-
```
31-
workflow "New workflow" {
32-
on = "push"
33-
resolves = ["ESLint"]
34-
}
35-
36-
action "ESLint" {
37-
uses = "stefanoeb/eslint-action@master"
38-
args = "index.js src/**.js"
39-
}
40-
```
21+
on: pull_request
4122
42-
If there is no previous step installing the necessary modules, this action will execute a `yarn install` or `npm install` automatically.
23+
jobs:
24+
eslint:
25+
runs-on: ubuntu-latest
26+
steps:
27+
- uses: actions/checkout@v1
28+
- uses: stefanoeb/eslint-action@1.0.0
29+
with:
30+
args: './src/**/*.{js,ts,tsx}'
31+
```
4332

44-
### Alternative: lint.yml
33+
By default it will run ESLint through all the files in the project. But you can also specify a glob of files on the `args`, just like ESLint:
4534

4635
```
4736
name: Lint
@@ -53,19 +42,13 @@ jobs:
5342
runs-on: ubuntu-latest
5443
steps:
5544
- uses: actions/checkout@v1
56-
with:
57-
fetch-depth: 1
58-
- uses: actions/setup-node@v1
59-
with:
60-
node-version: 12
61-
- run: npm ci --no-audit --prefer-offline
6245
- uses: stefanoeb/eslint-action@1.0.0
63-
env:
64-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6546
with:
66-
args: './src/**/*.{js,ts,tsx} --max-warnings 0'
47+
args: './src/**/*.{js,ts,tsx}'
6748
```
6849

50+
If there is no previous step installing the necessary modules, this action will execute a `yarn install` or `npm install` automatically.
51+
6952
## License
7053

7154
The Dockerfile and associated scripts and documentation in this project are released under the [MIT License](LICENSE).

0 commit comments

Comments
 (0)