@cryptotaxi247 / netdata-1 / commits / 8e23fc281

Skip ReviewDog runs for PRs that don’t need them. (#10148)

Austin S. Hemmelgarn committed Oct 28, 2020 at 07:07 UTC 8e23fc2814234db1b05b12b852f6de852e33a72c
1 file changed +28
.github/workflows/review.yml
+28
@@ -3,6 +3,10 @@
3 name: Review
4 on:
5 pull_request:
6 +env:
7 + run_eslint: 0
8 + run_shellcheck: 0
9 + run_yamllint: 0
10 jobs:
11 eslint:
12 name: eslint
@@ -10,7 +14,15 @@ jobs:
14 steps:
15 - name: Git clone repository
16 uses: actions/checkout@v2
17 + with:
18 + fetch-depth: 0
19 + - name: Check files
20 + run: |
21 + if git diff --name-only origin/${{ github.base_ref }} HEAD | grep -Eq '*\.js|node\.d\.plugin\.in' ; then
22 + echo ::set-env name=run_eslint::1
23 + fi
24 - name: Run eslint
25 + if: env.run_eslint == 1
26 uses: reviewdog/action-eslint@v1
27 with:
28 github_token: ${{ secrets.GITHUB_TOKEN }}
@@ -23,7 +35,15 @@ jobs:
35 steps:
36 - name: Git clone repository
37 uses: actions/checkout@v2
38 + with:
39 + fetch-depth: 0
40 + - name: Check files
41 + run: |
42 + if git diff --name-only origin/${{ github.base_ref }} HEAD | grep -Eq '*\.sh.*' ; then
43 + echo ::set-env name=run_shellcheck::1
44 + fi
45 - name: Run shellcheck
46 + if: env.run_shellcheck == 1
47 uses: reviewdog/action-shellcheck@v1
48 with:
49 github_token: ${{ secrets.GITHUB_TOKEN }}
@@ -38,7 +58,15 @@ jobs:
58 steps:
59 - name: Git clone repository
60 uses: actions/checkout@v2
61 + with:
62 + fetch-depth: 0
63 + - name: Check files
64 + run: |
65 + if git diff --name-only origin/${{ github.base_ref }} HEAD | grep -Eq '*\.ya?ml|python\.d/.*\.conf' ; then
66 + echo ::set-env name=run_yamllint::1
67 + fi
68 - name: Run yamllint
69 + if: env.run_yamllint == 1
70 uses: reviewdog/action-yamllint@v1
71 with:
72 github_token: ${{ secrets.GITHUB_TOKEN }}