-
Notifications
You must be signed in to change notification settings - Fork 12
45 lines (38 loc) · 1.31 KB
/
pr-validation.yml
File metadata and controls
45 lines (38 loc) · 1.31 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
41
42
43
44
45
# yaml-language-server: $schema=https://www.schemastore.org/github-workflow.json
---
name: Validate PR
on:
pull_request:
types: [opened, edited, synchronize, reopened]
issue_comment:
types: [created, edited]
jobs:
conventional-commits:
name: Validate PR title
runs-on: ubuntu-latest
steps:
- uses: amannn/action-semantic-pull-request@v6
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
commit-message-validation:
name: Validate commit messages
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Set up Node.js
uses: actions/setup-node@v5
with:
node-version: 24
- name: Install commitlint
run: |
npm install conventional-changelog-conventionalcommits
npm install @commitlint/config-conventional
npm install commitlint@latest
- name: Use default conventional configuration
run: |
echo "module.exports = { extends: ['@commitlint/config-conventional'] }" > $GITHUB_WORKSPACE/commitlint.config.cjs
- name: Validate PR commits with commitlint
run: npx commitlint --from ${{ github.event.pull_request.base.sha }} --to ${{ github.event.pull_request.head.sha }} --verbose