automate-github-issues
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseAutomate GitHub Issues with Jules
用Jules自动化处理GitHub Issues
You are setting up a repository to automatically analyze open GitHub issues, plan implementation tasks, and dispatch parallel Jules coding agents to fix them.
你将搭建一个仓库,用于自动分析开放的GitHub issues、规划实现任务,并调度并行的Jules编码代理来修复这些问题。
What You're Setting Up
你要搭建的内容
A 5-phase automated pipeline that runs via GitHub Actions (or locally):
- Analyze — Fetch open issues and format as structured markdown
- Plan — A Jules session performs deep code-level triage and produces self-contained task prompts
- Validate — Verify no two tasks modify the same file (prevents merge conflicts)
- Dispatch — Spawn parallel Jules sessions, one per task
- Merge — Sequential PR merge with CI validation
一个通过GitHub Actions(或本地运行)执行的5阶段自动化流水线:
- 分析 — 获取开放的issues并格式化为结构化markdown
- 规划 — 一个Jules会话执行深度代码级分类,并生成独立的任务提示词
- 验证 — 验证没有两个任务修改同一文件(防止合并冲突)
- 调度 — 生成并行的Jules会话,每个任务对应一个会话
- 合并 — 带CI验证的顺序PR合并
Setup Steps
搭建步骤
Step 1: Copy fleet scripts to the repository
步骤1:将集群脚本复制到仓库中
Copy the entire directory from this skill into the target repository at :
scripts/scripts/fleet/Target structure:
scripts/fleet/
├── fleet-analyze.ts
├── fleet-plan.ts
├── fleet-dispatch.ts
├── fleet-merge.ts
├── types.ts
├── prompts/
│ ├── analyze-issues.ts
│ └── bootstrap.ts
└── github/
├── git.ts
├── issues.ts
├── markdown.ts
└── cache-plugin.tsImportant: Preserve the directory structure exactly. The scripts use relative imports between files.
将本技能中的整个目录复制到目标仓库的路径下:
scripts/scripts/fleet/Target structure:
scripts/fleet/
├── fleet-analyze.ts
├── fleet-plan.ts
├── fleet-dispatch.ts
├── fleet-merge.ts
├── types.ts
├── prompts/
│ ├── analyze-issues.ts
│ └── bootstrap.ts
└── github/
├── git.ts
├── issues.ts
├── markdown.ts
└── cache-plugin.ts重要提示: 严格保留目录结构。脚本之间使用相对导入。
Step 2: Copy workflow templates
步骤2:复制工作流模板
Copy the workflow files from to the repository's directory:
assets/.github/workflows/- →
assets/fleet-dispatch.yml.github/workflows/fleet-dispatch.yml - →
assets/fleet-merge.yml.github/workflows/fleet-merge.yml
将中的工作流文件复制到仓库的目录下:
assets/.github/workflows/- →
assets/fleet-dispatch.yml.github/workflows/fleet-dispatch.yml - →
assets/fleet-merge.yml.github/workflows/fleet-merge.yml
Step 3: Create a package.json for the fleet scripts
步骤3:为集群脚本创建package.json
Create with the required dependencies:
scripts/fleet/package.jsonjson
{
"name": "fleet-scripts",
"private": true,
"type": "module",
"dependencies": {
"@google/jules-sdk": "^0.1.0",
"octokit": "^4.1.0",
"find-up": "^7.0.0"
},
"devDependencies": {
"@types/bun": "^1.2.0"
}
}创建,包含所需依赖:
scripts/fleet/package.jsonjson
{
"name": "fleet-scripts",
"private": true,
"type": "module",
"dependencies": {
"@google/jules-sdk": "^0.1.0",
"octokit": "^4.1.0",
"find-up": "^7.0.0"
},
"devDependencies": {
"@types/bun": "^1.2.0"
}
}Step 4: Create environment template
步骤4:创建环境变量模板
Copy to the repository root.
assets/.env.example将复制到仓库根目录。
assets/.env.exampleStep 5: Install dependencies
步骤5:安装依赖
bash
cd scripts/fleet && bun installbash
cd scripts/fleet && bun installStep 6: Print next steps for the user
步骤6:为用户打印后续步骤
Tell the user they need to:
- Add as a GitHub repository secret (Settings → Secrets → Actions)
JULES_API_KEY - is provided automatically by GitHub Actions
GITHUB_TOKEN - Customize the cron schedule in (default: daily 6am UTC)
.github/workflows/fleet-dispatch.yml - Commit all generated files
告知用户需要完成以下操作:
- 将添加为GitHub仓库密钥(设置 → 密钥 → Actions)
JULES_API_KEY - 由GitHub Actions自动提供
GITHUB_TOKEN - 自定义中的cron调度(默认:UTC时间每日早6点)
.github/workflows/fleet-dispatch.yml - 提交所有生成的文件
Manual Usage
手动使用
After setup, the user can run the pipeline locally:
bash
cd scripts/fleet搭建完成后,用户可以在本地运行流水线:
bash
cd scripts/fleetFetch open issues
获取开放的issues
bun fleet-analyze.ts
bun fleet-analyze.ts
Plan tasks (creates a Jules planning session)
规划任务(创建一个Jules规划会话)
JULES_API_KEY=<key> bun fleet-plan.ts
JULES_API_KEY=<key> bun fleet-plan.ts
Dispatch parallel agents
调度并行代理
JULES_API_KEY=<key> bun fleet-dispatch.ts
JULES_API_KEY=<key> bun fleet-dispatch.ts
Merge PRs sequentially
顺序合并PRs
GITHUB_TOKEN=<token> bun fleet-merge.ts
undefinedGITHUB_TOKEN=<token> bun fleet-merge.ts
undefinedCustomization
自定义
Prompt Tuning
提示词调优
The analysis prompt in controls how deeply issues are investigated. Users can adjust:
scripts/fleet/prompts/analyze-issues.ts- Root cause analysis depth
- Solution implementation detail level
- Merge conflict avoidance rules
- File ownership constraints
scripts/fleet/prompts/analyze-issues.ts- 根本原因分析深度
- 解决方案实现细节级别
- 合并冲突避免规则
- 文件所有权约束
Issue Filtering
问题过滤
Edit to filter issues by label, milestone, or state.
scripts/fleet/github/issues.ts编辑,可按标签、里程碑或状态过滤issues。
scripts/fleet/github/issues.tsResource References
资源参考
- Architecture Overview — Detailed explanation of the 5-phase pipeline
- Architecture Overview — 5阶段流水线的详细说明
Troubleshooting
故障排除
- "Unable to parse git remote URL": Ensure the repo has a valid GitHub remote ()
git remote get-url origin - Ownership conflict errors: Two tasks claim the same file. Adjust the task JSON or merge them manually.
- CI timeout during merge: Increase in
maxWaitMs(default: 10 minutes)fleet-merge.ts - Bun not found: Install Bun:
curl -fsSL https://bun.sh/install | bash
- "无法解析git远程URL":确保仓库有有效的GitHub远程地址()
git remote get-url origin - 所有权冲突错误:两个任务修改同一文件。调整任务JSON或手动合并它们。
- 合并时CI超时:增加中的
fleet-merge.ts(默认:10分钟)maxWaitMs - 未找到Bun:安装Bun:
curl -fsSL https://bun.sh/install | bash