fix: 将 Gitea 配置迁移到 ~/.gitea/config.yaml 多账号配置体系
CI / test (pull_request) Successful in 18s

- 新增 _get_gitea_config.py 从 YAML 读取 URL/repo/token
- _common.sh 改为通过 eval python 脚本加载配置
- GITEA_CICD_SETUP.md / DEV_AGENT.md / QE_AGENT.md 更新文档
- CI 工作流改用 ${{ gitea.server_url }} / ${{ gitea.repository }}

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
2026-06-05 17:05:14 +08:00
parent 2b5d901cfe
commit a8964db151
14 changed files with 202 additions and 87 deletions
+9 -9
View File
@@ -8,21 +8,21 @@ set -eu
_COMMON_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
PROJECT_DIR="${PROJECT_DIR:-$(cd "$_COMMON_DIR/.." && pwd)}"
# ── Load local secrets (not tracked by git) ────────────────────────────────────
if [ -f "$_COMMON_DIR/.env" ]; then
source "$_COMMON_DIR/.env"
# ── Load Gitea configuration ────────────────────────────────────────────────────
# Primary: ~/.gitea/config.yaml (requires GITEA_USER)
# Fallback: scripts/.env (backwards compat)
if ! eval "$(python "$_COMMON_DIR/_get_gitea_config.py" 2>/dev/null)"; then
# Fallback: source .env directly
if [ -f "$_COMMON_DIR/.env" ]; then
source "$_COMMON_DIR/.env"
fi
fi
# ── Default environment variables ──────────────────────────────────────────────
export GITEA_URL="${GITEA_URL:-https://git.zywl.me}"
export GITEA_REPO="${GITEA_REPO:-zeekrAI/document_analyzer}"
# ── Validate required environment ──────────────────────────────────────────────
require_token() {
if [ -z "${GITEA_API_TOKEN:-}" ]; then
echo "ERROR: GITEA_API_TOKEN is not set." >&2
echo "Set it in scripts/.env or export it:" >&2
echo " export GITEA_API_TOKEN=your-token" >&2
echo "Set it in ~/.gitea/config.yaml (with GITEA_USER) or scripts/.env." >&2
exit 1
fi
}