Skip to content

Commit

Permalink
Add GitHub Actions linting workflow.
Browse files Browse the repository at this point in the history
  • Loading branch information
junhaoliao committed Sep 14, 2024
1 parent 70b9d7b commit 542f5c1
Showing 1 changed file with 47 additions and 0 deletions.
47 changes: 47 additions & 0 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: "lint"

on:
pull_request:
types:
- "opened"
- "reopened"
- "synchronize"
push:
schedule:
# Run at midnight UTC every day with 15 minutes delay added to avoid high load periods
- cron: "15 0 * * *"
workflow_dispatch:

permissions:
# So the workflow can cancel in-progress jobs
actions: "write"

concurrency:
group: "${{github.workflow}}-${{github.ref}}"
# Cancel in-progress jobs for efficiency
cancel-in-progress: true

jobs:
lint-check:
runs-on: "ubuntu-latest"
permissions:
# So `eslint-annotate-action` can create / update status checks
checks: "write"
# So `eslint-annotate-action` can get pull request files
contents: "read"
steps:
- uses: "actions/checkout@v4"
with:
submodules: "recursive"
- uses: "actions/setup-node@v4"
with:
node-version: 22
- run: "npm --prefix client/ clean-install"
- run: "npm --prefix client/ run lint:ci"
continue-on-error: true
- uses: "ataylorme/eslint-annotate-action@v3"
with:
fail-on-error: true
fail-on-warning: true
only-pr-files: true
report-json: "./client/eslint-report.json"

0 comments on commit 542f5c1

Please sign in to comment.