diff --git a/.woodpecker/agent-smoke.sh b/.woodpecker/agent-smoke.sh index 322bcf0..9380ec5 100644 --- a/.woodpecker/agent-smoke.sh +++ b/.woodpecker/agent-smoke.sh @@ -21,14 +21,11 @@ FAILED=0 # Uses awk instead of grep -Eo for busybox/Alpine compatibility (#296). get_fns() { local f="$1" - # Use POSIX character classes and bracket-escaped parens for BusyBox awk - # compatibility (BusyBox awk does not expand \t to tab in character classes - # and may handle \( differently in ERE patterns). - awk '/^[[:space:]]*[a-zA-Z_][a-zA-Z0-9_]+[[:space:]]*[(][)]/ { - sub(/^[[:space:]]+/, "") - sub(/[[:space:]]*[(][)].*/, "") - print - }' "$f" 2>/dev/null | sort -u || true + # Use grep+sed instead of awk for BusyBox compatibility — BusyBox awk + # unreliably handles [(][)] bracket expressions in some Alpine builds. + grep -E '^[[:space:]]*[a-zA-Z_][a-zA-Z0-9_]+[[:space:]]*\(\)' "$f" 2>/dev/null \ + | sed 's/^[[:space:]]*//; s/[[:space:]]*().*$//' \ + | sort -u || true } # Extract call-position identifiers that look like custom function calls: diff --git a/bin/disinto b/bin/disinto index 5fa230d..f0599ec 100755 --- a/bin/disinto +++ b/bin/disinto @@ -808,6 +808,14 @@ OPSEOF # Commit and push seed content if [ "$seeded" = true ] && [ -d "${ops_root}/.git" ]; then + # Auto-configure repo-local git identity if missing (#778) + if [ -z "$(git -C "$ops_root" config user.name 2>/dev/null)" ]; then + git -C "$ops_root" config user.name "disinto-admin" + fi + if [ -z "$(git -C "$ops_root" config user.email 2>/dev/null)" ]; then + git -C "$ops_root" config user.email "disinto-admin@localhost" + fi + git -C "$ops_root" add -A if ! git -C "$ops_root" diff --cached --quiet 2>/dev/null; then git -C "$ops_root" commit -m "chore: seed ops repo structure" -q @@ -947,6 +955,17 @@ preflight_check() { fi fi + # ── Git identity check ── + if command -v git &>/dev/null; then + local git_name git_email + git_name=$(git config user.name 2>/dev/null) || git_name="" + git_email=$(git config user.email 2>/dev/null) || git_email="" + if [ -z "$git_name" ] || [ -z "$git_email" ]; then + echo "Warning: git user.name/user.email not configured" >&2 + echo " Init will set a repo-local identity for ops commits" >&2 + fi + fi + # ── Optional tools (warn only) ── if ! command -v docker &>/dev/null; then echo "Warning: docker not found (needed for Forgejo provisioning)" >&2