47 lines
1.3 KiB
Markdown
47 lines
1.3 KiB
Markdown
# Gitea API Quick Reference
|
|
|
|
**CRITICAL: This repository uses Gitea, NOT GitHub. Never use placeholder URLs.**
|
|
|
|
## Correct Gitea API Information
|
|
|
|
- **API Base URL**: `http://10.0.30.169:3000/api/v1`
|
|
- **Repository**: `ilia/nanobot`
|
|
- **Token**: Available in `$NANOBOT_GITLE_TOKEN` environment variable
|
|
|
|
## How to Detect (if needed)
|
|
|
|
```bash
|
|
# Get git remote
|
|
REMOTE=$(git remote get-url origin)
|
|
# Returns: gitea@10.0.30.169:ilia/nanobot.git
|
|
|
|
# Extract host (remove gitea@ and :repo.git)
|
|
HOST=$(echo "$REMOTE" | sed 's/.*@\([^:]*\).*/\1/')
|
|
# Returns: 10.0.30.169
|
|
|
|
# Extract repo path
|
|
REPO=$(echo "$REMOTE" | sed 's/.*:\(.*\)\.git/\1/')
|
|
# Returns: ilia/nanobot
|
|
|
|
# API base (Gitea runs on port 3000)
|
|
API_BASE="http://${HOST}:3000/api/v1"
|
|
```
|
|
|
|
## Example API Calls
|
|
|
|
```bash
|
|
# List pull requests
|
|
curl -H "Authorization: token $NANOBOT_GITLE_TOKEN" \
|
|
"http://10.0.30.169:3000/api/v1/repos/ilia/nanobot/pulls"
|
|
|
|
# List open issues
|
|
curl -H "Authorization: token $NANOBOT_GITLE_TOKEN" \
|
|
"http://10.0.30.169:3000/api/v1/repos/ilia/nanobot/issues?state=open"
|
|
|
|
# Get repository info
|
|
curl -H "Authorization: token $NANOBOT_GITLE_TOKEN" \
|
|
"http://10.0.30.169:3000/api/v1/repos/ilia/nanobot"
|
|
```
|
|
|
|
**DO NOT USE**: `gitea.example.com` or any placeholder URLs. Always use `10.0.30.169:3000`.
|