igneum/tools/ci/no-conflict-markers.sh
igneum-labs 974805b9df ci: no conflict markers in tracked files (check + pre-push hook that also builds the site)
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-05 16:45:09 +00:00

9 lines
677 B
Bash
Executable file

#!/usr/bin/env bash
# No tracked file may carry a merge conflict marker. 5 October 2026: a marker in the generated site/journey.json broke
# `node build.mjs` silently for two merges and a half-merged home page went live for a few minutes. Runs in CI and
# before every push from the main checkout (git hook installed by tools/ci/install-hooks.sh).
set -euo pipefail
cd "$(dirname "$0")/../.."
hits="$(git ls-files -z | xargs -0 grep -lE '^(<<<<<<< |=======$|>>>>>>> )' 2>/dev/null | grep -vE '^tools/ci/no-conflict-markers\.sh$' || true)"
if [ -n "$hits" ]; then echo "conflict markers in:"; echo "$hits" | sed 's/^/ /'; exit 1; fi
echo "no conflict markers in tracked files"