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:
@@ -11,8 +11,9 @@ tea pr list --login schweitz --repo jpmschweitzer/settled-reach --state open --o
|
||||
# View a PR with comments
|
||||
tea pr --login schweitz --repo jpmschweitzer/settled-reach --comments -o simple <PR_NUMBER>
|
||||
|
||||
# Post a comment on a PR (or issue)
|
||||
tooling/tea-comment <NUMBER> "comment body"
|
||||
# Post a comment on a PR (or issue) — use @filepath for long comments
|
||||
tooling/tea-comment <NUMBER> @/tmp/review.md
|
||||
tooling/tea-comment <NUMBER> "short inline comment"
|
||||
|
||||
# Approve a PR
|
||||
tea pr approve --login schweitz --repo jpmschweitzer/settled-reach <PR_NUMBER>
|
||||
@@ -25,7 +26,7 @@ tea issue list --login schweitz --repo jpmschweitzer/settled-reach --state open
|
||||
|
||||
- **All flags must be explicit** — omitting `--login` or `--repo` triggers interactive prompts that crash in Claude Code (no TTY)
|
||||
- **Use `--output simple`** for machine-readable output (no table borders)
|
||||
- **For comments, use `tooling/tea-comment <number> "body"`** — handles temp files and cleanup automatically. Works with multi-line strings.
|
||||
- **For comments, use `tooling/tea-comment <number> @/tmp/file.md`** for long comments (write to file first, then pass `@filepath`). Short inline strings also work: `tooling/tea-comment <number> "body"`. The `@filepath` form avoids `$()` subshells which break permission matching.
|
||||
- **`tea pr reject` does not work on your own PRs** — use `tea comment` instead
|
||||
- **Never delete protected branches:** `main`, `maintenance`, `server`, `client`, `copy`, `audio`, `visual`, `ci` are protected on Gitea. Do not use `tea pr clean`, `git push --delete`, or `git branch -D` on these branches.
|
||||
|
||||
|
||||
@@ -185,10 +185,15 @@ After presenting results to the user, post the review as a PR comment.
|
||||
|
||||
Note: `tea pr reject` does not work on your own PRs. Use `tea comment` instead.
|
||||
|
||||
Post using the `tea-comment` wrapper (handles temp files and cleanup):
|
||||
Post using the `tea-comment` wrapper (handles temp files and cleanup).
|
||||
Write the review to a temp file first, then pass via `@filepath` syntax:
|
||||
|
||||
```bash
|
||||
tooling/tea-comment <PR_NUMBER> "review markdown here"
|
||||
# Write review to file, then post — avoids $() in the command which breaks permissions
|
||||
cat > /tmp/pr-review-<NUMBER>.md << 'EOF'
|
||||
...review content...
|
||||
EOF
|
||||
tooling/tea-comment <PR_NUMBER> @/tmp/pr-review-<NUMBER>.md
|
||||
```
|
||||
|
||||
## 7. Merging approved PRs
|
||||
|
||||
+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