-
Notifications
You must be signed in to change notification settings - Fork 0
48 lines (37 loc) · 1.07 KB
/
ci.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
44
45
46
47
48
name: CI
on:
push:
branches: ["main"]
pull_request:
types: ["opened", "synchronize"]
workflow_dispatch:
inputs:
lint_fix:
description: "lint:fix"
required: false
type: boolean
default: true
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-ci
cancel-in-progress: true
env:
fixLintingErrors: ${{ fromJSON(inputs.lint_fix || 'false') || github.event_name == 'pull_request' && github.head_ref != 'main' }}
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
with:
version: 9.4.0
run_install: true
- run: pnpm typecheck
- run: pnpm lint
if: ${{ ! fromJSON(env.fixLintingErrors) }}
- run: pnpm lint:fix
if: ${{ fromJSON(env.fixLintingErrors) }}
- name: Commit linter fixes
uses: stefanzweifel/git-auto-commit-action@8621497c8c39c72f3e2a999a26b4ca1b5058a842 #v5
if: ${{ fromJSON(env.fixLintingErrors) }}
with:
commit_message: "pnpm lint:fix"