cal.pub0.org/.github/workflows/lint.yml

49 lines
1.1 KiB
YAML
Raw Normal View History

name: Lint
on:
2022-07-06 17:31:34 +00:00
pull_request:
branches:
- main
2022-07-05 01:13:51 +00:00
paths:
2022-07-12 00:27:24 +00:00
- "**.tsx?"
- "**.jsx?"
jobs:
lint:
2022-07-12 00:27:24 +00:00
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v2
with:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 2
2022-07-12 00:27:24 +00:00
- name: Use Node 16.x
2022-05-18 04:30:16 +00:00
uses: actions/setup-node@v3
with:
2022-07-12 00:27:24 +00:00
node-version: 16.x
2022-05-18 04:30:16 +00:00
cache: "yarn"
- name: Install deps
if: steps.yarn-cache.outputs.cache-hit != 'true'
2022-05-18 04:30:16 +00:00
run: yarn --frozen-lockfile
- name: Lint
run: yarn lint:report
continue-on-error: true
- name: Merge lint reports
run: jq -s '[.[]]|flatten' lint-results/*.json &> lint-results/eslint_report.json
- name: Annotate Code Linting Results
uses: ataylorme/eslint-annotate-action@1.2.0
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
report-json: "lint-results/eslint_report.json"
- name: Upload ESLint report
if: ${{ always() }}
uses: actions/upload-artifact@v2
with:
name: lint-results
path: lint-results