feat: add pre-commit for conventional commit

Signed-off-by: David van der Spek <vanderspek.david@gmail.com>
This commit is contained in:
David van der Spek
2023-09-28 13:30:31 +02:00
parent 3fc1216dc3
commit c6e6adaf0e
3 changed files with 46 additions and 0 deletions

View File

@@ -0,0 +1,15 @@
name: Conventional Commits
on:
pull_request:
branches: [ main ]
jobs:
build:
name: Conventional Commits
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Conventional Commit
uses: webiny/action-conventional-commits@v1.1.0

7
.pre-commit-config.yaml Normal file
View File

@@ -0,0 +1,7 @@
repos:
- repo: https://github.com/compilerla/conventional-pre-commit
rev: v2.4.0
hooks:
- id: conventional-pre-commit
stages: [commit-msg]
args: [] # optional: list of Conventional Commits types to allow e.g. [feat, fix, ci, chore, test]

View File

@@ -74,6 +74,30 @@ You should follow the basic GitHub workflow:
Refer to [containerd's contribution guide](https://github.com/containerd/project/blob/master/CONTRIBUTING.md#successful-changes)
for tips on creating a successful contribution.
## Commit Formatting
This project adheres to [Conventional Commit](https://www.conventionalcommits.org/en/v1.0.0/#specification) for commit formatting. To make adhering to Conventional Commit easier [pre-commit](https://pre-commit.com/) can be used to validate commit messages before they are created. To install the [pre-commit](https://pre-commit.com/) and the git hook please run the following commands:
### Install pre-commit
```bash
pip install pre-commit
```
Or on Mac:
```bash
brew install pre-commit
```
For more options please see the pre-commit [installation instructions](https://pre-commit.com/#install)
### Install the git hook
```bash
pre-commit install
```
## Sign your work
The sign-off is a simple line at the end of the explanation for the patch. Your