Some checks failed
CI / commitlint (pull_request) Has been cancelled
CI / lint (pull_request) Has been cancelled
CI / test (pull_request) Has been cancelled
CI / build (pull_request) Has been cancelled
CI / commitlint (push) Has been cancelled
CI / lint (push) Has been cancelled
CI / test (push) Has been cancelled
CI / build (push) Has been cancelled
21 lines
675 B
Bash
21 lines
675 B
Bash
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
|
|
# Local commit-msg hook using commitlint via npx (no Docker/GHCR auth required).
|
|
# Usage: scripts/commit-msg.sh <commit-msg-file>
|
|
|
|
MSG_FILE="${1:?path to commit message file required}"
|
|
|
|
if ! command -v npx >/dev/null 2>&1; then
|
|
echo "npx not found. Install Node.js and run: npm install --save-dev @commitlint/cli" >&2
|
|
exit 1
|
|
fi
|
|
|
|
# Ensure commitlint is available (installed as devDependency)
|
|
if ! npx --yes @commitlint/cli@latest --help >/dev/null 2>&1; then
|
|
echo "Install commitlint locally: npm install --save-dev @commitlint/cli" >&2
|
|
exit 1
|
|
fi
|
|
|
|
npx --yes @commitlint/cli@latest --config .commitlintrc.yml --edit "${MSG_FILE}"
|