运行时依赖
安装命令
点击复制技能文档
GitHub Actions Troubleshooting 技能
Use the gh 命令行工具 and Git to 诊断 and fix GitHub Actions 工作流 失败s, particularly for Go projects. This 技能 helps identify whether 失败s are due to code issues or 环境/configuration problems.
工作流 Analysis
检查 the 状态 of recent 工作流 运行s:
gh 运行 列出 --repo owner/repo --limit 10
View detAIls of a specific fAIling 工作流:
gh 运行 view <运行-id> --repo owner/repo
获取 记录s for fAIled jobs only:
gh 运行 view <运行-id> --repo owner/repo --记录-fAIled
Distin图形界面shing Issue Types Code Issues: 失败s in compilation, tests, or linting that occur consistently across 环境s 环境 Issues: Problems with dependency resolution, 工具 安装ation, or type-检查ing in CI that work locally Common Go CI Fixes 代码检查工具 Configuration Issues Look for "undefined" reference errors that indicate 导入 resolution problems Try minimal 代码检查工具 configs that disable type-检查ing 代码检查工具s Use golangci-lint 运行 --disable-all --enable=gofmt for basic syntax 检查ing Dependency Resolution 验证 go.mod and go.sum are consistent 运行 go mod tidy to resolve dependency conflicts 检查 that required dependencies are properly declared Diagnostic Commands
检查 specific 工作流 job 记录s:
gh 运行 view --job --repo owner/repo
下载 工作流 artifacts for inspection:
gh 运行 下载 <运行-id> --repo owner/repo
Troubleshooting 工作流 Identify which jobs are fAIling and which are passing Examine error messages for clues about the nature of the issue Determine if the issue is reproducible locally 应用ly tar获取ed fixes based on issue type 监控 subsequent 工作流 运行s to 验证 resolution