docs: update README with usage and validation rules (#7)
Reviewed-on: #7 Co-authored-by: Jan Klattenhoff <jan@kjan.email> Co-committed-by: Jan Klattenhoff <jan@kjan.email>
This commit is contained in:
parent
08b43cc51b
commit
7e2de542b6
1 changed files with 39 additions and 1 deletions
40
README.md
40
README.md
|
@ -1,3 +1,41 @@
|
|||
# pull-request-lint
|
||||
|
||||
Lints the title of a pull request
|
||||
A GitHub/Gitea Action that lints pull request titles to ensure they follow the [Conventional Commits](https://www.conventionalcommits.org/) format.
|
||||
|
||||
## Usage
|
||||
|
||||
Add the following to your GitHub/Gitea workflow:
|
||||
|
||||
```yaml
|
||||
name: Pull Request Lint
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
types: [opened, edited, reopened, synchronize]
|
||||
|
||||
jobs:
|
||||
lint:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Install go
|
||||
uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version: 1.24.2
|
||||
- uses: https://git.kjan.de/actions/pull-request-lint@release
|
||||
```
|
||||
|
||||
## Validation Rules
|
||||
|
||||
The action enforces the following Conventional Commits rules for PR titles:
|
||||
|
||||
- Format must be: `type(scope)!: description` (scope and breaking change marker `!` are optional)
|
||||
- Type and scope must be lowercase
|
||||
- Description must start with lowercase
|
||||
- Breaking change indicator and footer are mutually exclusive
|
||||
- Body must be separated from description by a blank line
|
||||
- Footer tokens must use hyphens instead of spaces (except for "BREAKING CHANGE")
|
||||
|
||||
## License
|
||||
|
||||
See [LICENSE](LICENSE) file for details.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue