mirror of
https://github.com/Matysh/houseplan-card
synced 2026-10-02 04:38:55 +00:00
32 lines
1.0 KiB
Bash
32 lines
1.0 KiB
Bash
#!/bin/sh
|
|
set -eu
|
|
|
|
message_file=$1
|
|
|
|
# Git-generated merge commits do not represent an independently authored
|
|
# product change and inherit provenance from their parents.
|
|
case "$(basename "$message_file")" in
|
|
MERGE_MSG) exit 0 ;;
|
|
esac
|
|
|
|
if ! grep -Eq '^Issue: #[0-9]+[[:space:]]*$' "$message_file"; then
|
|
echo "House Plan: missing 'Issue: #<number>' trailer (see PROCESS.md)." >&2
|
|
exit 1
|
|
fi
|
|
if ! grep -Eq '^User-Visible: (yes|no)[[:space:]]*$' "$message_file"; then
|
|
echo "House Plan: missing 'User-Visible: yes|no' trailer (see PROCESS.md)." >&2
|
|
exit 1
|
|
fi
|
|
|
|
if git diff --cached --name-only --diff-filter=ACMR \
|
|
| grep -Eq '^demo/golden/baselines/.*\.(png|json)$'; then
|
|
if ! grep -Eq '^Release: [^[:space:]].*$' "$message_file"; then
|
|
echo "House Plan: a golden baseline commit requires a Release trailer." >&2
|
|
exit 1
|
|
fi
|
|
if ! grep -Eq '^Baseline-Reviewed: [^[:space:]].*$' "$message_file"; then
|
|
echo "House Plan: a golden baseline commit requires Baseline-Reviewed provenance." >&2
|
|
exit 1
|
|
fi
|
|
fi
|