2020-09-24 19:18:57 +03:00
|
|
|
name: Lint
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
2021-02-03 21:56:02 +03:00
|
|
|
- main
|
2021-09-22 02:15:59 +03:00
|
|
|
pull_request:
|
2020-09-24 20:18:40 +03:00
|
|
|
branches:
|
2021-02-03 21:56:02 +03:00
|
|
|
- main
|
2020-09-24 19:18:57 +03:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
run-linters:
|
|
|
|
name: Run linters
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
steps:
|
2021-04-21 20:35:49 +03:00
|
|
|
- name: Checkout
|
2020-09-24 19:18:57 +03:00
|
|
|
uses: actions/checkout@v2
|
|
|
|
|
|
|
|
- name: Set up node
|
2021-04-21 20:35:49 +03:00
|
|
|
uses: actions/setup-node@v2
|
2020-09-24 19:18:57 +03:00
|
|
|
with:
|
2021-04-21 20:35:49 +03:00
|
|
|
node-version: 14
|
2020-09-24 19:18:57 +03:00
|
|
|
registry-url: https://registry.npmjs.org
|
|
|
|
|
2021-05-30 04:06:49 +03:00
|
|
|
- name: Get yarn cache directory path
|
|
|
|
id: yarn-cache-dir-path
|
|
|
|
run: echo "::set-output name=dir::$(yarn cache dir)"
|
|
|
|
|
|
|
|
- uses: actions/cache@v2
|
|
|
|
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
|
|
|
|
with:
|
|
|
|
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
|
|
|
|
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
|
|
|
|
restore-keys: |
|
|
|
|
${{ runner.os }}-yarn-
|
|
|
|
|
2020-09-24 19:18:57 +03:00
|
|
|
- name: Install dependencies
|
2020-09-24 19:35:53 +03:00
|
|
|
run: yarn install --frozen-lockfile
|
2020-09-24 19:18:57 +03:00
|
|
|
|
2021-11-30 23:20:59 +03:00
|
|
|
- name: Run eslint w/ autofix
|
|
|
|
if: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.owner.login == github.repository_owner }}
|
2021-09-22 02:15:59 +03:00
|
|
|
uses: wearerequired/lint-action@36c7e6689e80d785d27a22f71d970f3a3b4fcb70
|
2020-09-24 19:18:57 +03:00
|
|
|
with:
|
|
|
|
github_token: ${{ secrets.github_token }}
|
|
|
|
eslint: true
|
2021-11-30 23:20:59 +03:00
|
|
|
eslint_args: "-c .eslintrc.json"
|
|
|
|
auto_fix: true
|
|
|
|
|
|
|
|
- name: Run eslint
|
|
|
|
if: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.repo.owner.login != github.repository_owner }}
|
|
|
|
run: yarn eslint .
|