1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798 |
- ---
- # Runs various ReviewDog based checks against PR with suggested changes to improve quality
- name: Review
- on:
- pull_request: null
- env:
- run_eslint: 0
- run_hadolint: 0
- run_shellcheck: 0
- run_yamllint: 0
- DO_NOT_TRACK: 1
- jobs:
- eslint:
- name: eslint
- runs-on: ubuntu-latest
- steps:
- - name: Git clone repository
- uses: actions/checkout@v2
- with:
- submodules: recursive
- fetch-depth: 0
- - name: Check files
- run: |
- if git diff --name-only origin/${{ github.base_ref }} HEAD | grep -v "web/gui/dashboard" | grep -Eq '*\.js|node\.d\.plugin\.in' ; then
- echo 'run_eslint=1' >> $GITHUB_ENV
- fi
- - name: Run eslint
- if: env.run_eslint == 1
- uses: reviewdog/action-eslint@v1
- with:
- github_token: ${{ secrets.GITHUB_TOKEN }}
- reporter: github-pr-check
- eslint_flags: '.'
- hadolint:
- name: hadolint
- runs-on: ubuntu-latest
- 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 '*Dockerfile*' ; then
- echo 'run_hadolint=1' >> $GITHUB_ENV
- fi
- - name: Run hadolint
- if: env.run_hadolint == 1
- uses: reviewdog/action-hadolint@v1
- with:
- github_token: ${{ secrets.GITHUB_TOKEN }}
- reporter: github-pr-check
- shellcheck:
- name: shellcheck
- runs-on: ubuntu-latest
- steps:
- - name: Git clone repository
- uses: actions/checkout@v2
- with:
- submodules: recursive
- fetch-depth: 0
- - name: Check files
- run: |
- if git diff --name-only origin/${{ github.base_ref }} HEAD | grep -Eq '*\.sh.*' ; then
- echo 'run_shellcheck=1' >> $GITHUB_ENV
- fi
- - name: Run shellcheck
- if: env.run_shellcheck == 1
- uses: reviewdog/action-shellcheck@v1
- with:
- github_token: ${{ secrets.GITHUB_TOKEN }}
- reporter: github-pr-check
- path: "."
- pattern: "*.sh*"
- exclude: "./.git/*"
- yamllint:
- name: yamllint
- runs-on: ubuntu-latest
- steps:
- - name: Git clone repository
- uses: actions/checkout@v2
- with:
- submodules: recursive
- 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 'run_yamllint=1' >> $GITHUB_ENV
- fi
- - name: Run yamllint
- if: env.run_yamllint == 1
- uses: reviewdog/action-yamllint@v1
- with:
- github_token: ${{ secrets.GITHUB_TOKEN }}
- reporter: github-pr-check
|