conventional-commits-check-.../README.md

51 lines
1.4 KiB
Markdown
Raw Permalink Normal View History

2025-01-02 23:29:07 +01:00
# Conventional Commits Check Action
A [GitHub Action](https://github.com/features/actions) / [Gitea Action](https://docs.gitea.com/usage/actions/overview) for enforcing adherance to [Conventional Commits](https://pypi.org/project/conventional-pre-commit/).
You can use the Action as follows:
```yaml
name: Validate PR Title
on:
pull_request_target:
types:
- opened
- edited
- synchronize
- reopened
- labeled
- unlabeled
jobs:
validate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
2025-01-02 23:36:16 +01:00
- uses: https://git.tainton.uk/actions/conventional-commits-check-action@v1.0.0
2025-01-02 23:29:07 +01:00
with:
commit-message: ${{ github.event.pull_request.title }}
```
```yaml
name: Validate Commit Message
on:
push:
branches:
- main
jobs:
validate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
2025-01-02 23:36:16 +01:00
- uses: https://git.tainton.uk/actions/conventional-commits-check-action@v1.0.0
2025-01-02 23:29:07 +01:00
with:
commit-message: ${{ github.event.head_commit.message }}
```
## Properties
The Conventional Commits Check Action has a property which is passed to the underlying script. These are passed to the action using `with`.
| Property | Description |
| -------------- | ---------------------------------------------- |
| commit-message | The commit message you would like to validate. |