69 lines (64 loc) · 2.07 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
name: Lint & format
on:
push:
branches-ignore: [dev, main]
pull_request:
branches: [dev]
concurrency:
group: ${{ github.workflow }}-${{ github.event.ref || github.ref }}
cancel-in-progress: true
jobs:
lintformat:
name: 'Lint & format'
runs-on: ubuntu-latest
steps:
# Setup steps
- name: Checkout
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3
with:
ref: ${{ github.head_ref }}
fetch-depth: 0
- name: Import GPG key
id: import_gpg
uses: crazy-max/ghaction-import-gpg@111c56156bcc6918c056dbef52164cfa583dc549 # v5
with:
gpg_private_key: ${{ secrets.BOT_GPG_KEY }}
git_config_global: true
git_commit_gpgsign: true
- name: Install Node.js
uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3
with:
node-version: 16
- uses: pnpm/action-setup@c3b53f6a16e57305370b4ae5a540c2077a1d50dd # v2.2.4
name: Install pnpm
id: pnpm-install
with:
run_install: false
- name: Get pnpm store directory
id: pnpm-cache
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
- uses: actions/cache@4723a57e26efda3a62cbde1812113b730952852d # v3
name: Setup pnpm cache
with:
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install dependencies
run: pnpm install
# Linting & Formatting
- name: Lint workspace
run: pnpm lint:pkg
- name: Lint projects
run: pnpm lint:fix
- name: Format projects
run: pnpm format
# Commit changes
- name: Commit changed files
uses: stefanzweifel/git-auto-commit-action@3ea6ae190baf489ba007f7c92608f33ce20ef04a # v4
with:
commit_message: 'chore: lint & format'
skip_fetch: true
skip_checkout: true