Skip to content

Commit 69dccd6

Browse files
authored
ci: adds action to lint conventional commits (#1902)
1 parent afc7698 commit 69dccd6

File tree

1 file changed

+47
-0
lines changed

1 file changed

+47
-0
lines changed
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Conventional Commits
2+
on:
3+
pull_request:
4+
types:
5+
- opened
6+
- edited
7+
- synchronize
8+
jobs:
9+
default:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: amannn/action-semantic-pull-request@v5
13+
id: lint
14+
env:
15+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
16+
with:
17+
types: |
18+
build
19+
chore
20+
ci
21+
docs
22+
feat
23+
fix
24+
perf
25+
style
26+
refactor
27+
test
28+
- uses: marocchino/sticky-pull-request-comment@v2
29+
if: always() && (steps.lint.outputs.error_message != null)
30+
with:
31+
header: lint-error
32+
message: |
33+
Hey there! 👋
34+
35+
We noticed that the title of your pull request doesn't follow the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) specification. To ensure consistency, we kindly ask you to adjust the title accordingly.
36+
37+
Details are below the break:
38+
39+
----------------------------
40+
41+
${{ steps.lint.outputs.error_message }}
42+
43+
- if: ${{ steps.lint.outputs.error_message == null }}
44+
uses: marocchino/sticky-pull-request-comment@v2
45+
with:
46+
header: lint-error
47+
delete: true

0 commit comments

Comments
 (0)