ci: runner fix - check all runner configs
Runner Diagnose / diagnose (push) Successful in 0s
Runner Fix & Scale / fix-all-runners (push) Successful in 0s

This commit is contained in:
灵应
2026-07-12 01:35:16 +08:00
parent 7de5acbb8d
commit 0753b5b775
+44
View File
@@ -0,0 +1,44 @@
name: Runner Fix & Scale
on:
push:
branches:
- ci/runner-fix
jobs:
fix-all-runners:
runs-on: host
steps:
- name: 一次性修复所有runner标签
run: |
set -e
CI_DIR="/var/lib/xiaoxia-ci"
ACT_BIN="$CI_DIR/act_runner"
GITEA_URL="https://git.xiaoxiajianji.com"
TOKEN="token123" # 会在下面替换
echo "========== 1. 查当前3个runner的配置 =========="
for d in "$CI_DIR" "$CI_DIR/runner-2" "$CI_DIR/runner-3"; do
echo "--- $d ---"
if [ -f "$d/.runner" ]; then
cat "$d/.runner" | python3 -c "import sys,json; d=json.load(sys.stdin); print(f'name={d.get(\"name\",\"?\")} labels={d.get(\"labels\",[])} uuid={d.get(\"uuid\",\"?\")[:8]}')" 2>/dev/null || cat "$d/.runner"
elif [ -f "$d/.runner-config.yaml" ]; then
head -30 "$d/.runner-config.yaml"
else
echo "no config found"
ls -la "$d/" | head -20
fi
echo ""
done
echo "========== 2. 查当前systemd服务 =========="
for s in act_runner.service act_runner-2.service act_runner-3.service; do
echo "--- $s ---"
systemctl cat "$s" 2>/dev/null | head -20
echo ""
done
echo "========== 3. 查Gitea API的runner列表 =========="
curl -sk -H "Authorization: token 1f8058d097e3942a9ed31c44382baf7f08311272" \
"$GITEA_URL/api/v1/repos/xiaoxia/xiaoxia-saas/actions/runners?limit=20" 2>/dev/null | python3 -m json.tool 2>/dev/null || echo "API call failed"
echo "========== 完成 =========="