Skip to content

Commit 181b04e

Browse files
ci: add pull request title linting and optimize workflows
1 parent 842c344 commit 181b04e

File tree

2 files changed

+23
-18
lines changed

2 files changed

+23
-18
lines changed

.github/workflows/go.yml

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ on:
77
branches:
88
- 'master'
99
pull_request:
10-
types: [opened, synchronize, reopened, edited]
1110
paths-ignore:
1211
- packaging/**
1312
branches:
@@ -16,7 +15,6 @@ on:
1615
jobs:
1716
test:
1817
name: Test
19-
if: github.event.action != 'edited'
2018
runs-on: ${{ matrix.os }}
2119
strategy:
2220
matrix:
@@ -39,7 +37,6 @@ jobs:
3937
run: make test-ci
4038
test-flaky:
4139
name: Test (flaky)
42-
if: github.event.action != 'edited'
4340
runs-on: ubuntu-latest
4441
continue-on-error: ${{ github.ref == 'refs/heads/master' }}
4542
steps:
@@ -66,21 +63,6 @@ jobs:
6663
with:
6764
cache: false
6865
go-version-file: go.mod
69-
- name: Setup Node.js
70-
if: github.event_name == 'pull_request'
71-
uses: actions/setup-node@v4
72-
with:
73-
node-version: '20'
74-
- name: Install commitlint
75-
if: github.event_name == 'pull_request'
76-
run: |
77-
npm install --save-dev @commitlint/cli @commitlint/config-conventional
78-
- name: PR title linting
79-
if: github.event_name == 'pull_request'
80-
env:
81-
PR_TITLE: ${{ github.event.pull_request.title }}
82-
run: |
83-
echo "$PR_TITLE" | npx commitlint --config ./commitlint.config.js
8466
- name: Commit linting
8567
if: github.ref != 'refs/heads/master'
8668
uses: wagoid/commitlint-github-action@v5

.github/workflows/pr-title.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: PR Title Lint
2+
3+
on:
4+
pull_request:
5+
types: [opened, synchronize, reopened, edited]
6+
7+
jobs:
8+
lint-title:
9+
name: Lint PR Title
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout
13+
uses: actions/checkout@v4
14+
- name: Setup Node
15+
uses: actions/setup-node@v4
16+
with:
17+
node-version: '20'
18+
- name: Install commitlint
19+
run: npm install --save-dev @commitlint/cli @commitlint/config-conventional
20+
- name: PR title linting
21+
env:
22+
PR_TITLE: ${{ github.event.pull_request.title }}
23+
run: echo "$PR_TITLE" | npx commitlint --config ./commitlint.config.js

0 commit comments

Comments
 (0)