🐛 fix(gitea-fix-ci): trace workflow_run CI chains

This commit is contained in:
csh
2026-08-20 15:56:40 +08:00
parent 5a8d95ebcf
commit 77ab8211b1
6 changed files with 429 additions and 194 deletions
+37
View File
@@ -0,0 +1,37 @@
# 取证回退路径
仅在脚本不可用、Actions API 返回 404,或只有用户日志时读取本文件。
## tea actions
先确认安装、登录和子命令能力;不同 tea 版本不一定提供 Actions
```bash
tea login list
tea actions --help
tea pulls view <pr>
tea actions runs list --status failure
tea actions runs view <run-id>
tea actions runs logs <run-id> --job <job-id>
```
仍需先读取 workflow `on:` 段。遇到 `workflow_run` 链时,先查 Prepare,再按下游
workflow 和时间定位候选;不要用 PR 分支过滤下游 run。
## Legacy web
Gitea 1.21 及更早可能有 Actions web UI,但没有 run/job/log API
1. 打开 `/<owner>/<repo>/actions`,找到目标 run。
2. 打开 `/<owner>/<repo>/actions/runs/<run>`,读取每个 job 的状态。
3. 选择状态为 `failure` 的 job index,再下载
`/<owner>/<repo>/actions/runs/<run>/jobs/<job-index>/logs`
4. 不要默认 index `0`;只有页面不暴露 job 状态时才逐一扫描。
Prepare 失败时读取 Prepare 页和其失败 job;下游可能显示 `skipped` 或根本不出现在
PR checks 中,不要把它误报为“找不到失败 run”。
## 用户粘贴日志
把日志标记为用户提供的证据,并明确:远端 run/job、workflow、SHA 与状态均未核验。
只引用首个可操作错误块;日志不含 run/job 身份时,不把推测写成事实。