-
Notifications
You must be signed in to change notification settings - Fork 7
40 lines (34 loc) · 1.34 KB
/
Copy pathcommit-lint.yml
File metadata and controls
40 lines (34 loc) · 1.34 KB
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
# owner: @team-devex
# purpose: Standard automation workflow
name: Lint Commit Messages
on: [pull_request]
permissions:
pull-requests: write
jobs:
commitlint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: wagoid/commitlint-github-action@v6
- name: Post Comment on Failure
if: failure()
uses: peter-evans/create-or-update-comment@v5
with:
issue-number: ${{ github.event.pull_request.number }}
body: |
:no_entry: **Commit Message Linting Failed**
One or more of your commit messages do not follow the project's conventions.
Please review the [commitlint logs](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}) for more details.
You can also refer to the [commit message guidelines](https://github.com/conventional-changelog/commitlint/#what-is-commitlint) for help.
pr-title-lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: pnpm install @commitlint/cli @commitlint/config-conventional
- name: Lint PR title
env:
PR_TITLE: ${{ github.event.pull_request.title }}
run: echo "$PR_TITLE" | pnpm exec commitlint --config commitlint.config.cjs