Files
lukas ffb926b2a2
Some checks failed
Rust / build_and_test (push) Successful in 30s
Release / build_release (push) Has been cancelled
chore(pr): Version bump to v0.1.7 (#4)
2026-01-18 00:40:34 +01:00

20 lines
595 B
Bash

#!/bin/sh
# Path to the commit message file
COMMIT_MSG_FILE=$1
# Read the commit message
COMMIT_MSG=$(cat "$COMMIT_MSG_FILE")
# Regex pattern for Conventional Commits
# Example: "feat: add new feature" or "fix!: break everything"
PATTERN='^(feat|fix|docs|style|refactor|perf|test|chore|revert|build|ci|wip|workflow)(\(.*\))?([!]?): .{1,}$'
if ! echo "$COMMIT_MSG" | grep -Eq "$PATTERN"; then
echo "❌ Invalid commit message format."
echo "Please follow the Conventional Commits specification: https://www.conventionalcommits.org/"
echo "Example: 'feat: add new feature'"
exit 1
fi