-
Notifications
You must be signed in to change notification settings - Fork 1
45 lines (36 loc) · 1.06 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
name: Lint
on:
pull_request:
workflow_call:
jobs:
code:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: "1.23"
cache: false # Disable cache since golangci-lint does its own caching
- name: Lint source code
uses: golangci/golangci-lint-action@v4
with:
version: latest
commits:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-node@v4
with:
node-version: lts/*
- name: Install commitlint
run: |
npm install @commitlint/config-conventional
npm install commitlint
- name: Validate current commit (last commit) with commitlint
if: github.event_name == 'push'
run: npx commitlint --last --verbose
- name: Validate PR title with commitlint
if: github.event_name == 'pull_request'
run: echo '${{ github.event.pull_request.title }}' | npx commitlint --verbose