aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/.github/workflows/lint.yml
blob: bfa9530393dd5cd414c3d418c5c162af2bfb28cb (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
name: UI Auto Lint

on:
  push:
    branches: ["main", "dev"]
    paths:
      - "ui/**"
  workflow_dispatch:

permissions:
  contents: write

jobs:
  fix:
    if: github.event_name != 'pull_request'
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v6
        with:
          token: ${{ secrets.GITHUB_TOKEN }}

      - name: Install pnpm
        uses: pnpm/action-setup@v4
        with:
          version: latest

      - name: Install Node.js
        uses: actions/setup-node@v4
        with:
          node-version: 22
          cache: "pnpm"
          cache-dependency-path: "ui/pnpm-lock.yaml"

      - run: pnpm install
        working-directory: ui

      - run: pnpm format
        working-directory: ui

      - run: pnpm lint:fix
        working-directory: ui

      - name: Commit changes
        uses: stefanzweifel/git-auto-commit-action@v5
        with:
          commit_message: "style: auto format and lint fix [skip ci]"
          file_pattern: "ui/**"