Replace gitea-create-pr.sh script with tea CLI
Removed custom PR creation script in favor of native tea CLI tool. Before: /home/cal/.claude/scripts/gitea-create-pr.sh cal/repo branch main "Title" After: tea pulls create --repo cal/repo --head branch --base main --title "Title" Benefits: - No custom script maintenance - Native Gitea CLI with better error handling - Support for labels, assignees, milestones - Consistent with other Gitea operations Updated CLAUDE.md with tea pulls create examples. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
b74e3ebde2
commit
b2b024f0e3
79
CLAUDE.md
79
CLAUDE.md
@ -38,78 +38,27 @@ This is NOT optional - it loads required CLAUDE.md context. along the file path.
|
||||
- `git push`
|
||||
- Any deployment scripts that commit internally
|
||||
|
||||
## Gitea PR Automation
|
||||
## Gitea Operations
|
||||
|
||||
**Script Location:** `/home/cal/.claude/scripts/gitea-create-pr.sh`
|
||||
**Token Location:** `/home/cal/.claude/secrets/gitea_token`
|
||||
**Gitea Instance:** https://git.manticorum.com
|
||||
**ALWAYS use `tea` CLI for Gitea.** Never use `gh api --hostname` — it's not compatible with Gitea's API.
|
||||
|
||||
### When to Use
|
||||
- Authenticated: `cal@homelab` (https://git.manticorum.com)
|
||||
- Common: `tea repos list`, `tea pulls list`, `tea issues list`, `tea pulls create`
|
||||
|
||||
Create PRs automatically to trigger Gitea Actions (version validation, Docker builds) before merging to main.
|
||||
|
||||
### Usage
|
||||
### Create PR (triggers Gitea Actions)
|
||||
|
||||
```bash
|
||||
/home/cal/.claude/scripts/gitea-create-pr.sh \
|
||||
<owner/repo> \
|
||||
<head-branch> \
|
||||
<base-branch> \
|
||||
<title> \
|
||||
[description]
|
||||
# From within repo directory
|
||||
tea pulls create --head <branch> --base main --title "Title" --description "Description"
|
||||
|
||||
# Or specify repo from anywhere
|
||||
tea pulls create --repo cal/major-domo-database --head fix/feature --base main --title "Title" --description "Description"
|
||||
|
||||
# With labels, assignees, milestone
|
||||
tea pulls create --head fix/feature --base main --title "Title" --labels bug,priority --assignees cal --milestone v1.2.0
|
||||
```
|
||||
|
||||
### Example Workflow
|
||||
|
||||
```bash
|
||||
# 1. Create feature branch and make changes
|
||||
git checkout -b fix/some-feature
|
||||
# ... make changes ...
|
||||
git add .
|
||||
git commit -m "fix: Description"
|
||||
|
||||
# 2. Push to Gitea
|
||||
git push homelab fix/some-feature
|
||||
|
||||
# 3. Create PR automatically
|
||||
/home/cal/.claude/scripts/gitea-create-pr.sh \
|
||||
cal/major-domo-database \
|
||||
fix/some-feature \
|
||||
main \
|
||||
"fix: Some feature description" \
|
||||
"Detailed description of changes
|
||||
|
||||
## Changes
|
||||
- Change 1
|
||||
- Change 2
|
||||
|
||||
## Testing
|
||||
- Test case 1"
|
||||
```
|
||||
|
||||
### Benefits
|
||||
|
||||
- ✅ Triggers semantic version validation on PRs
|
||||
- ✅ Runs Docker builds before merging to main
|
||||
- ✅ Enables code review workflow
|
||||
- ✅ Creates git tags on successful deployment
|
||||
- ✅ Prevents breaking main branch
|
||||
|
||||
### Common Repositories
|
||||
|
||||
```bash
|
||||
# Major Domo Database
|
||||
cal/major-domo-database
|
||||
|
||||
# Major Domo Bot
|
||||
cal/major-domo-bot
|
||||
|
||||
# Paper Dynasty
|
||||
cal/paper-dynasty
|
||||
|
||||
# Paper Dynasty Database
|
||||
cal/paper-dynasty-database
|
||||
```
|
||||
**Common repos:** cal/major-domo-database, cal/major-domo-bot, cal/paper-dynasty, cal/paper-dynasty-database
|
||||
|
||||
## Tech Preferences
|
||||
|
||||
|
||||
@ -1,72 +0,0 @@
|
||||
#!/bin/bash
|
||||
# Gitea PR Creation Helper
|
||||
# Creates pull requests on git.manticorum.com via API
|
||||
#
|
||||
# Usage:
|
||||
# gitea-create-pr.sh <owner/repo> <head-branch> <base-branch> <title> [description]
|
||||
#
|
||||
# Example:
|
||||
# gitea-create-pr.sh cal/major-domo-database fix/my-feature main "Fix: My feature" "Description here"
|
||||
|
||||
set -e
|
||||
|
||||
# Check arguments
|
||||
if [ $# -lt 4 ]; then
|
||||
echo "Usage: $0 <owner/repo> <head-branch> <base-branch> <title> [description]"
|
||||
echo ""
|
||||
echo "Example:"
|
||||
echo " $0 cal/paper-dynasty fix/feature main 'Fix: Feature title' 'Optional description'"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
REPO="$1"
|
||||
HEAD_BRANCH="$2"
|
||||
BASE_BRANCH="$3"
|
||||
TITLE="$4"
|
||||
DESCRIPTION="${5:-Automated PR created by Claude Code}"
|
||||
|
||||
# Load token
|
||||
GITEA_TOKEN=$(cat /home/cal/.claude/secrets/gitea_token | tr -d '\n')
|
||||
|
||||
if [ -z "$GITEA_TOKEN" ]; then
|
||||
echo "ERROR: Gitea token not found at /home/cal/.claude/secrets/gitea_token"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Create PR via Gitea API
|
||||
echo "Creating PR on https://git.manticorum.com/$REPO"
|
||||
echo " Head: $HEAD_BRANCH"
|
||||
echo " Base: $BASE_BRANCH"
|
||||
echo " Title: $TITLE"
|
||||
echo ""
|
||||
|
||||
RESPONSE=$(curl -s -X POST \
|
||||
-H "Authorization: token $GITEA_TOKEN" \
|
||||
-H "Content-Type: application/json" \
|
||||
"https://git.manticorum.com/api/v1/repos/$REPO/pulls" \
|
||||
-d @- <<EOF
|
||||
{
|
||||
"title": "$TITLE",
|
||||
"head": "$HEAD_BRANCH",
|
||||
"base": "$BASE_BRANCH",
|
||||
"body": "$DESCRIPTION"
|
||||
}
|
||||
EOF
|
||||
)
|
||||
|
||||
# Check for errors
|
||||
if echo "$RESPONSE" | grep -q '"message"'; then
|
||||
echo "ERROR: Failed to create PR"
|
||||
echo "$RESPONSE" | jq -r '.message // .'
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Extract PR number and URL
|
||||
PR_NUMBER=$(echo "$RESPONSE" | jq -r '.number')
|
||||
PR_URL=$(echo "$RESPONSE" | jq -r '.html_url')
|
||||
|
||||
echo "PR created successfully!"
|
||||
echo " Number: #$PR_NUMBER"
|
||||
echo " URL: $PR_URL"
|
||||
echo ""
|
||||
echo "Gitea Actions will now run on this PR."
|
||||
@ -100,5 +100,6 @@
|
||||
"type": "command",
|
||||
"command": "input=$(cat); cwd=$(echo \"$input\" | jq -r '.workspace.current_dir // .cwd'); display_cwd=$(echo \"$cwd\" | sed \"s|^$HOME|~|\"); if git -C \"$cwd\" rev-parse --git-dir >/dev/null 2>&1; then branch=$(git -C \"$cwd\" branch --show-current 2>/dev/null); [ -n \"$branch\" ] && git_info=\" \\033[33m($branch)\\033[0m\" || git_info=\"\"; else git_info=\"\"; fi; pulse=$(/usr/bin/python \"/home/cal/.claude/scripts/claude-pulse/claude_status.py\" <<< \"$input\"); printf \"\\033[34m%s\\033[0m%b\\n\" \"$display_cwd\" \"$git_info\"; [ -n \"$pulse\" ] && printf \"%s\" \"$pulse\"; printf \"\\n\""
|
||||
},
|
||||
"effortLevel": "medium"
|
||||
"effortLevel": "medium",
|
||||
"model": "sonnet"
|
||||
}
|
||||
|
||||
@ -177,7 +177,7 @@ Auto-generated summary of highest-relevance memories. Loaded into system prompt
|
||||
|
||||
```markdown
|
||||
# Memory Core (auto-generated)
|
||||
> Last updated: 2025-12-13 | Active memories: 180/313 | Next refresh: manual
|
||||
> Last updated: 2025-12-13 | Active memories: 180/313 | Next refresh: daily (systemd timer)
|
||||
|
||||
## Critical Solutions
|
||||
- [title](relative/path.md) (tag1, tag2)
|
||||
|
||||
@ -1281,7 +1281,7 @@ class CognitiveMemoryClient:
|
||||
|
||||
lines = [
|
||||
"# Memory Core (auto-generated)",
|
||||
f"> Last updated: {now_str} | Active memories: {active_count}/{total_count} | Next refresh: manual",
|
||||
f"> Last updated: {now_str} | Active memories: {active_count}/{total_count} | Next refresh: daily (systemd timer)",
|
||||
"",
|
||||
]
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user