mirror of
https://github.com/distribution/distribution.git
synced 2025-08-31 06:34:11 +00:00
feat: add pre-commit for conventional commit
Signed-off-by: David van der Spek <vanderspek.david@gmail.com>
This commit is contained in:
15
.github/workflows/conventional-commit.yml
vendored
Normal file
15
.github/workflows/conventional-commit.yml
vendored
Normal 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
7
.pre-commit-config.yaml
Normal 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]
|
@@ -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
|
||||
|
Reference in New Issue
Block a user