Skip to content

Commit af74ff7

Browse files
committed
ci: add conventional commits validation
1 parent f332260 commit af74ff7

2 files changed

Lines changed: 64 additions & 1 deletion

File tree

.github/workflows/commitlint.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Commit Lint
2+
3+
on:
4+
pull_request:
5+
types: [opened, synchronize, reopened, edited]
6+
7+
jobs:
8+
commitlint:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v4
12+
with:
13+
fetch-depth: 0
14+
15+
- name: Validate PR title
16+
uses: amannn/action-semantic-pull-request@v5
17+
env:
18+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
19+
with:
20+
types: |
21+
feat
22+
fix
23+
docs
24+
style
25+
refactor
26+
perf
27+
test
28+
build
29+
ci
30+
chore
31+
revert
32+
requireScope: false
33+
subjectPattern: ^[a-z].+$
34+
subjectPatternError: |
35+
The subject "{subject}" must start with a lowercase letter.

CONTRIBUTING.md

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,38 @@ Feature requests are welcome! Please open an issue and describe:
2929
3. Make your changes
3030
4. Ensure tests pass and code style is maintained
3131
5. Update documentation (`doc/vue-sfc-format.txt`) if you've added or changed features
32-
6. Commit your changes (`git commit -am 'Add some feature'`)
32+
6. Commit your changes following the [Conventional Commits](https://www.conventionalcommits.org/) format
3333
7. Push to the branch (`git push origin feature/my-new-feature`)
3434
8. Create a new Pull Request
3535

36+
### Commit Message Format
37+
38+
This project follows the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) specification.
39+
40+
```
41+
<type>: <description>
42+
```
43+
44+
**Types:**
45+
- `feat`: A new feature
46+
- `fix`: A bug fix
47+
- `docs`: Documentation changes
48+
- `style`: Code style changes (formatting, whitespace)
49+
- `refactor`: Code refactoring without feature changes
50+
- `perf`: Performance improvements
51+
- `test`: Adding or updating tests
52+
- `build`: Build system or dependency changes
53+
- `ci`: CI/CD configuration changes
54+
- `chore`: Maintenance tasks
55+
56+
**Examples:**
57+
```
58+
feat: add support for custom script formatters
59+
fix: resolve parsing error with nested template tags
60+
docs: update configuration examples in README
61+
refactor: simplify section extraction logic
62+
```
63+
3664
## Development Setup
3765

3866
### Testing

0 commit comments

Comments
 (0)