Skip to content

Commit 9b5aea0

Browse files
committed
ci: add lint workflow
1 parent 7e32be9 commit 9b5aea0

File tree

1 file changed

+51
-0
lines changed

1 file changed

+51
-0
lines changed

.github/workflows/lint.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: Lint
2+
3+
on:
4+
push:
5+
branches: [ "main" ]
6+
pull_request:
7+
branches: [ "main" ]
8+
9+
jobs:
10+
lint:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout repository
14+
uses: actions/checkout@v4
15+
with:
16+
fetch-depth: 0
17+
18+
- name: Ensure main branch exists
19+
if: github.ref != 'refs/heads/main'
20+
run: |
21+
set -euo pipefail
22+
23+
git rev-parse --verify main \
24+
|| git remote set-branches origin main \
25+
&& git fetch --depth 1 origin main \
26+
&& git branch main origin/main
27+
28+
- name: Setup pnpm
29+
uses: pnpm/action-setup@v4
30+
with:
31+
version: 10.7
32+
33+
- name: Setup Node.js
34+
uses: actions/setup-node@v4
35+
with:
36+
node-version: 22
37+
cache: "pnpm"
38+
39+
- name: Setup GoLang
40+
uses: actions/setup-go@v5
41+
with:
42+
go-version-file: "go.work"
43+
44+
- name: Install dependencies
45+
run: pnpm install --frozen-lockfile
46+
47+
- name: Run Linters
48+
run: |
49+
set -euo pipefail
50+
51+
npx nx affected -t lint

0 commit comments

Comments
 (0)