用途:该技能用于将 CI 失败分诊为 GitHub Issue。输入一个 GitHub Actions 的作业 URL 或运行 URL,它会定位失败作业、抓取日志、提取根因,并在 NVIDIA/Megatron-LM 仓库创建结构化的 bug issue。
主要能力:解析 URL 提取 run_id 与 job_id;列出运行中所有失败作业;用 gh api 拉取作业日志并筛选错误行;解析触发 PR 及测试文件作者;提取失败测试节点 ID、错误信息、作业名与链接;搜索是否已有重复 issue;创建 issue 并指派给测试作者。
使用方式:通过 gh 命令操作。列出失败作业:gh run view <run_id> --repo NVIDIA/Megatron-LM --json jobs --jq '[.jobs[] | select(.conclusion == "failure") | {id: .databaseId, name: .name, url: .url}]'。抓取日志:gh api repos/NVIDIA/Megatron-LM/actions/jobs/<job_id>/logs 2>&1 | grep -E "(FAILED|ERROR|\bError\b|assert|Traceback|Exception|##[error])" | head -200。创建 issue:gh issue create --repo NVIDIA/Megatron-LM --title "🐛 CI failure: <failed-test-node-id>" --label "bug" --assignee "<test-author-login>" --body "..."。
适用场景:Megatron-LM 仓库的 CI 失败自动分诊,将失败测试转为可跟踪的 bug issue。
限制:仅针对 NVIDIA/Megatron-LM 仓库;依赖 gh CLI 与有效认证;若作业仍在进行或日志不可用,需等待运行完成;存在重复 issue 时不新建;作者查找失败时跳过指派;错误片段需控制在 30 行内,不得猜测根因。