Files
LLeMbas-IDE/scripts/hygiene.sh
T
HomerandClaude Fable 5.2 9de046c603
release / release (push) Failing after 50m4s
A GitHub Release for a tag, made from the signed Gitea release of the same tag
ide/install.sh reads GitHub's releases by default, and a mirror carries
none: the workflow waits for the Gitea release, checks it as the
installer would, and publishes the same files.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-12-01 22:56:46 +00:00

41 lines
1.6 KiB
Bash
Executable File

#!/usr/bin/env bash
# The repository is public: nothing in it may name the private estate it was written on.
# The LLeMbas section rule ("everything public is current-state and estate-free"), as a check
# that runs in CI on every push rather than a sentence somebody has to remember.
#
# Patterns are the kinds of thing that leak: a private domain, an internal `.lan` name, a
# container number, a private address range, a machine's name. This file is the one place that
# may spell them, and is skipped.
set -euo pipefail
cd "$(dirname "$0")/.."
patterns=(
'houmeres'
'\b[a-z0-9-]+\.lan\b'
'\bCT ?2[0-9]{2}\b'
'\b10\.0\.0\.[0-9]+'
'\b192\.168\.[0-9]+\.[0-9]+'
'\bgamebox\b'
'\bthor\b'
)
# What is allowed to match, each for a reason — a line of `file:line:text` as grep prints it:
allowed=(
# The public forge the releases are made on: the workflow that republishes them must name it.
'^\.github/workflows/release\.yml:[0-9]+:.*git\.houmeres\.sk'
)
allow="$(IFS='|'; echo "${allowed[*]}")"
found=0
for pattern in "${patterns[@]}"; do
# The output decides, not the exit status: xargs answers 123 when any one batch of files has no
# match, and grep 2 on an error -- either would have read as "clean" around real matches.
hits=$(git ls-files -z | grep -zv '^scripts/hygiene.sh$' | xargs -0 grep -nIEi -- "$pattern" 2>/dev/null | grep -vE -- "$allow" || true)
if [ -n "$hits" ]; then
printf '%s\n' "$hits"
echo "hygiene: the lines above match /$pattern/" >&2
found=1
fi
done
[ "$found" -eq 0 ] && echo "hygiene: nothing private in the tracked files"
exit "$found"