diff options
author | Austin S. Hemmelgarn <austin@netdata.cloud> | 2020-10-28 07:07:01 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-28 07:07:01 -0400 |
commit | 8e23fc2814234db1b05b12b852f6de852e33a72c (patch) | |
tree | 6f321d9b93e1d4908587381e08a9267946b5ac4e /.github | |
parent | 9049aa99e576363eb7be2a95ee1669c7ced15697 (diff) |
Skip ReviewDog runs for PRs that don’t need them. (#10148)
Diffstat (limited to '.github')
-rw-r--r-- | .github/workflows/review.yml | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/.github/workflows/review.yml b/.github/workflows/review.yml index d1277634c1..67e2affcc1 100644 --- a/.github/workflows/review.yml +++ b/.github/workflows/review.yml @@ -3,6 +3,10 @@ name: Review on: pull_request: +env: + run_eslint: 0 + run_shellcheck: 0 + run_yamllint: 0 jobs: eslint: name: eslint @@ -10,7 +14,15 @@ jobs: steps: - name: Git clone repository uses: actions/checkout@v2 + with: + fetch-depth: 0 + - name: Check files + run: | + if git diff --name-only origin/${{ github.base_ref }} HEAD | grep -Eq '*\.js|node\.d\.plugin\.in' ; then + echo ::set-env name=run_eslint::1 + fi - name: Run eslint + if: env.run_eslint == 1 uses: reviewdog/action-eslint@v1 with: github_token: ${{ secrets.GITHUB_TOKEN }} @@ -23,7 +35,15 @@ jobs: steps: - name: Git clone repository uses: actions/checkout@v2 + with: + fetch-depth: 0 + - name: Check files + run: | + if git diff --name-only origin/${{ github.base_ref }} HEAD | grep -Eq '*\.sh.*' ; then + echo ::set-env name=run_shellcheck::1 + fi - name: Run shellcheck + if: env.run_shellcheck == 1 uses: reviewdog/action-shellcheck@v1 with: github_token: ${{ secrets.GITHUB_TOKEN }} @@ -38,7 +58,15 @@ jobs: steps: - name: Git clone repository uses: actions/checkout@v2 + with: + fetch-depth: 0 + - name: Check files + run: | + if git diff --name-only origin/${{ github.base_ref }} HEAD | grep -Eq '*\.ya?ml|python\.d/.*\.conf' ; then + echo ::set-env name=run_yamllint::1 + fi - name: Run yamllint + if: env.run_yamllint == 1 uses: reviewdog/action-yamllint@v1 with: github_token: ${{ secrets.GITHUB_TOKEN }} |