This repository has been archived on 2026-08-05. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
nanobot/workspace/gitea_api.sh
T

29 lines
686 B
Bash
Executable File

#!/bin/bash
# Gitea API helper script - ALWAYS uses HTTP (not HTTPS)
API_BASE="http://10.0.30.169:3000/api/v1"
REPO="ilia/nanobot"
TOKEN="${NANOBOT_GITLE_TOKEN}"
if [ -z "$TOKEN" ]; then
echo "Error: NANOBOT_GITLE_TOKEN not set"
exit 1
fi
case "$1" in
prs|pulls)
curl -s -H "Authorization: token $TOKEN" \
"${API_BASE}/repos/${REPO}/pulls"
;;
issues)
curl -s -H "Authorization: token $TOKEN" \
"${API_BASE}/repos/${REPO}/issues?state=${2:-open}"
;;
*)
echo "Usage: $0 {prs|pulls|issues} [state]"
echo "Example: $0 prs"
echo "Example: $0 issues open"
exit 1
;;
esac