chore(skills): tea-comment @filepath support and docs update
tea-comment now accepts @/path/to/file.md syntax to read comment body from a file, avoiding $() subshells that break permission matching. Updated pr-review skill and tea-cli rules with the new pattern. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
+16
-2
@@ -1,15 +1,29 @@
|
||||
#!/usr/bin/env bash
|
||||
# Post a comment to a Gitea PR or issue.
|
||||
# Usage: tea-comment <number> "comment body"
|
||||
# tea-comment <number> @/path/to/file.md
|
||||
set -euo pipefail
|
||||
|
||||
if [[ $# -lt 2 ]]; then
|
||||
echo "Usage: tea-comment <number> <comment>" >&2
|
||||
echo "Usage: tea-comment <number> <comment|@filepath>" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
NUMBER="$1"
|
||||
BODY="$2"
|
||||
INPUT="$2"
|
||||
|
||||
# If the body starts with @, read from file
|
||||
if [[ "$INPUT" == @* ]]; then
|
||||
FILEPATH="${INPUT#@}"
|
||||
if [[ ! -f "$FILEPATH" ]]; then
|
||||
echo "Error: file not found: $FILEPATH" >&2
|
||||
exit 1
|
||||
fi
|
||||
BODY=$(cat "$FILEPATH")
|
||||
else
|
||||
BODY="$INPUT"
|
||||
fi
|
||||
|
||||
HASH=$(echo -n "$BODY" | md5sum | cut -c1-8)
|
||||
TMPFILE="/tmp/tea-comment-${NUMBER}-${HASH}.md"
|
||||
trap 'rm -f "$TMPFILE"' EXIT
|
||||
|
||||
Reference in New Issue
Block a user