Single-command wrapper that handles temp file creation and cleanup so tea comment works reliably with multi-line strings. Pre-approved in settings.json, referenced in CLAUDE.md and pr-review skill. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
19 lines
489 B
Bash
Executable File
19 lines
489 B
Bash
Executable File
#!/usr/bin/env bash
|
|
# Post a comment to a Gitea PR or issue.
|
|
# Usage: tea-comment <number> "comment body"
|
|
set -euo pipefail
|
|
|
|
if [[ $# -lt 2 ]]; then
|
|
echo "Usage: tea-comment <number> <comment>" >&2
|
|
exit 1
|
|
fi
|
|
|
|
NUMBER="$1"
|
|
BODY="$2"
|
|
HASH=$(echo -n "$BODY" | md5sum | cut -c1-8)
|
|
TMPFILE="/tmp/tea-comment-${NUMBER}-${HASH}.md"
|
|
trap 'rm -f "$TMPFILE"' EXIT
|
|
|
|
printf '%s' "$BODY" > "$TMPFILE"
|
|
tea comment --login schweitz --repo jpmschweitzer/settled-reach "$NUMBER" "$(cat "$TMPFILE")"
|