-
Notifications
You must be signed in to change notification settings - Fork 0
84 lines (64 loc) · 2.37 KB
/
linter.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
name: "eslint"
on: [push]
jobs:
eslint:
name: runner / eslint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 2
- uses: actions/setup-node@v2
with:
node-version: 19
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.0.0'
bundler-cache: true
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'adopt'
- name: Cache local Maven repository
uses: actions/cache@v3
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Building gitdiff
run: |
mvn install -f gitdiff
- name: Running gitdiff
run: java -jar gitdiff/target/gitdiff-0.1.jar > gitdiff/gitdiff.yaml
- name: Install npm dependencies
run: npm i --force # OR: yarn
- name: Running eslint
run: npx eslint $(git diff --name-only HEAD^ | grep -E '\.(ts|tsx)$' | xargs) --format json > eslinted.json || true
- name: Running filter
run: ruby gitdiff/filter_diff.rb gitdiff/gitdiff.yaml eslinted.json > filtered.json
- uses: reviewdog/action-setup@v1
with:
reviewdog_version: latest
- name: Running reviewdog
env:
REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: cat filtered.json | reviewdog -f=rdjson -reporter=github-check
# github-pr-review
# - name: Annotate
# uses: actions/annotations
# # - name: Adding annotations
# - name: Install dependencies
# run: npm i --force # OR: yarn
# - name: Install other deps
# run: npm install --force --save-dev eslint-plugin-n@latest
# - name: Run eslint on changed files
# uses: tj-actions/eslint-changed-files@v20
# with:
# config_path: ".eslintrc.yml"
# fail_on_error: false
# file_extensions: |
# **/*.ts
# **/*.tsx