2.8 KiB
2.8 KiB
description
| description |
|---|
| List all global runners on Gitea server |
List all global runners registered on the Gitea server.
工作目录
macOS / Linux:
~/.config/gitea/
Windows:
%USERPROFILE%\.config\gitea\
Please perform the following:
-
Read Gitea configuration:
- Read from config file:
- macOS/Linux:
~/.config/gitea/config.env - Windows:
%USERPROFILE%\.config\gitea\config.env
- macOS/Linux:
- Extract:
GITEA_URL: Gitea server URLGITEA_TOKEN: API token (admin permission required)
- If config not found: prompt user to run
/gitea-resetfirst
- Read from config file:
-
Call Gitea API to list runners:
curl -s -H "Authorization: token <token>" \
"<server>/api/v1/admin/actions/runners"
-
Parse JSON response and extract information:
- Response structure:
{ "runners": [...], "total_count": 1 } - Use
jqto parse JSON - For each runner in
runnersarray:id: Runner IDname: Runner namestatus: Runner status ("online"/"offline")busy: Whether runner is currently busy (true/false)ephemeral: Whether runner is ephemeral (true/false)labels: Array of label objects withnameandtype
- Response structure:
-
Determine runner status:
- 🟢 在线 -
status: "online" - 🔴 离线 -
status: "offline" - ⚠️ 未知 - Unable to determine
- 🟢 在线 -
-
Filter global runners:
- The API endpoint
/api/v1/admin/actions/runnersreturns all global runners - These are runners registered at the instance level (not org or repo specific)
- The API endpoint
-
Display summary in Chinese:
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Gitea 全局 Runners
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
服务器: [server_url]
总计: N 个全局 runner
[runner-name]
状态: 🟢/🔴 [在线/离线]
ID: [id]
忙碌: 是/否
临时: 是/否
标签: [comma-separated labels]
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
管理命令
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
查看配置: /gitea-config
创建 runner: /gitea-create-runner
删除 runner: /gitea-delete-runner
Notes:
- Requires admin API token to list runners
- Correct API endpoint:
/api/v1/admin/actions/runners(not/api/v1/admin/runners) - Only shows global runners (instance-level runners)
- Uses
jqfor JSON parsing - Response includes:
id,name,status,busy,ephemeral,labels - If API call fails, show error message and suggest checking token permissions
- Tested with Gitea version 1.25.3