Skip to content

Commit 776a632

Browse files
authoredNov 3, 2023
chore: add commit lint workflow (#19)
* Add commit lint workflow * add commitlint config
1 parent e905388 commit 776a632

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed
 

‎.github/workflows/commitlint.yaml

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: PR Title Check
2+
3+
on:
4+
pull_request:
5+
branches: [main]
6+
types: [opened, edited, synchronize]
7+
8+
jobs:
9+
title_check:
10+
runs-on: ubuntu-latest
11+
permissions:
12+
pull-requests: read
13+
14+
steps:
15+
- name: Checkout
16+
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
17+
with:
18+
fetch-depth: 0
19+
20+
- name: Setup Node.js
21+
uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65 # v4.0.0
22+
23+
- name: Install commitlint
24+
run: npm install --save-dev @commitlint/{config-conventional,cli}
25+
26+
- name: Lint PR title
27+
run: echo "${{ github.event.pull_request.title }}" | npx commitlint

‎commitlint.config.js

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
module.exports = { extends: ["@commitlint/config-conventional"] };

0 commit comments

Comments
 (0)
Please sign in to comment.