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

47 lines
1.1 KiB
YAML
Raw Normal View History

name: Lint
on:
pull_request_target:
branches:
- main
jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v2
with:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 2
- name: Use Node.js 14.x
2022-02-09 22:24:14 +00:00
uses: actions/setup-node@v2
with:
node-version: 14.x
cache: "yarn"
cache-dependency-path: yarn.lock
- name: Install deps
if: steps.yarn-cache.outputs.cache-hit != 'true'
2022-02-09 22:24:14 +00:00
run: yarn
- 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