
Commit lint action
Github commit lint action
Versions
Introduction
This is template repository for new libraries
Example
name: Commit Lint
on:
workflow_call:
inputs:
branch:
required: false
type: string
default: "main"
prefixes:
required: true
default: "Add|Fix|Update|Remove|Refactor|Docs|Test|Improve|Merge|Bump"
description: "List of all allowed prefix [TYPE] where type can be Add, Fix, use Add|Fix|Update ..."
minLengthText:
required: true
default: 8
description: "Minimal length after [TYPE] for commit message"
pull_request:
types: [opened, synchronize, edited]
push:
branches:
- master
- main
- develop
- feature/**
- release/**
- test/**
- bugfix/**
jobs:
lint-commits:
runs-on: ubuntu-latest
steps:
- name: Commit lint
uses: gouef/commit-lint-action@main
Commit rules
Commit message should looks like
[TYPE] some message
Pre-commit
Requirements:
- pre-commit
pre-commit install --hook-type commit-msg
.pre-commit-config
repos:
- repo: https://github.com/gouef/commit-lint-action
rev: v1.1.1
hooks:
- id: check-commit-msg
args: [
"-p", "Add|Fix|Update|Remove|Refactor|Docs|Test|Improve|Merge|Bump", # List of all allowed prefix [TYPE] where type can be Add, Fix, use Add|Fix|Update ...
"-l", "6" # Minimal length after [TYPE] for commit message
]