43 lines
1.1 KiB
YAML
43 lines
1.1 KiB
YAML
name: Lint
|
|
on:
|
|
workflow_call:
|
|
pull_request_target:
|
|
branches:
|
|
- main
|
|
paths:
|
|
- "**.tsx?"
|
|
- "**.jsx?"
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
|
cancel-in-progress: true
|
|
jobs:
|
|
lint:
|
|
runs-on: buildjet-4vcpu-ubuntu-2204
|
|
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- uses: ./.github/actions/dangerous-git-checkout
|
|
- uses: ./.github/actions/yarn-install
|
|
- name: Test Code Linting
|
|
run: yarn lint
|
|
- name: Save Code Linting Reports
|
|
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@v2
|
|
with:
|
|
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
|
report-json: "lint-results/eslint_report.json"
|
|
only-pr-files: false
|
|
|
|
- name: Upload ESLint report
|
|
if: ${{ always() }}
|
|
uses: actions/upload-artifact@v2
|
|
with:
|
|
name: lint-results
|
|
path: lint-results
|