diff options
Diffstat (limited to '.github/workflows')
| -rw-r--r-- | .github/workflows/check.yml | 13 | ||||
| -rw-r--r-- | .github/workflows/lint.yml | 47 |
2 files changed, 58 insertions, 2 deletions
diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 0cbcf35..58fc378 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -4,9 +4,11 @@ on: push: paths: - "ui/**" - - ".github/workflows/ui_check.yml" + - ".github/workflows/check.yml" pull_request: - branches: ["main", "master", "dev"] + paths: + - "ui/**" + - ".github/workflows/check.yml" workflow_dispatch: jobs: @@ -32,3 +34,10 @@ jobs: - run: pnpm check working-directory: ui + + - run: pnpm lint + working-directory: ui + + - run: pnpm format --check + working-directory: ui + diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 0000000..5c4a69d --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,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@v4 + with: + token: ${{ secrets.GITHUB_TOKEN }} + + - name: Install pnpm + uses: pnpm/action-setup@v4 + with: + version: 9 + + - 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/**" |