-
Notifications
You must be signed in to change notification settings - Fork 12
43 lines (43 loc) · 1.17 KB
/
lint.yml
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
name: Lint
on:
workflow_dispatch:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
lint:
timeout-minutes: 60
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}
fetch-depth: 0
- uses: pnpm/action-setup@v4
with:
version: latest
run_install: false
- uses: actions/setup-node@v4
with:
node-version: 20
cache: 'pnpm'
- name: Install Dependencies
run: |
pnpm i --no-optional
- name: Run lint
run: |
pnpm prettier --ignore-path ./.prettierignore --write **/*.{ts,yml,md}
pnpm eslint --cache --fix .
- name: Commit files
id: commit
continue-on-error: true
run: |
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git commit -a -m "style: lint"
- name: Push changes
uses: ad-m/github-push-action@master
if: ${{ steps.commit.outcome == 'success' }}
with:
branch: ${{ github.head_ref }}