#!/bin/sh
# should-skip-release — reads a commit message on stdin. Exits 0 when the
# release tagger should skip this commit, 1 when it should tag.
#
# Skipping is opt-in via a git trailer:
#
#   Skip-Release: true
#
# It is a TRAILER, matched anchored to its own line, deliberately. The first
# version searched the whole message for a bracketed marker as a substring,
# and the very commit that introduced the manifest-bump step described that
# marker in its body — so the tagger read its own documentation as an
# instruction and skipped the release. Success, no tag, no bump, no error
# (run 15, 2026-08-23). A marker you cannot mention without triggering is a
# footgun, not a mechanism.

set -u

msg=$(cat)

if printf '%s\n' "$msg" | grep -qiE '^[[:space:]]*Skip-Release:[[:space:]]*true[[:space:]]*$'; then
  exit 0
fi

exit 1
