用 GitHub Copilot 自动化 Dependabot 拉取请求分类
GitHub Copilot app for Beginners: Automate Dependabot pull request triage
I might be biased, but I think Dependabot is pretty amazing. It helps keep my projects up to date, ensuring I’m always using secure libraries. But because there’re frequently new vulnerabilities, there’re frequently new pull requests from Dependabot.
我可能有偏见,但我觉得 Dependabot 非常棒。它帮助我的项目保持最新,确保我总是使用安全的库。但由于经常出现新的漏洞,Dependabot 也经常发出新的拉取请求。
Sometimes it’s a minor version bump. Sometimes it’s a major version upgrade. Sometimes everything will work just fine. And sometimes… well, every single developer has been caught by a breaking change.
有时是次要版本升级,有时是主要版本升级。有时一切正常,有时……嗯,每个开发者都曾被破坏性变更坑过。
How can we best triage these pull requests? The work isn’t particularly difficult per se, but it certainly is repetitive.
我们如何最好地处理这些拉取请求?这项工作本身并不特别困难,但确实重复性很高。
It’s the perfect task to offload to Copilot! With GitHub Copilot app automations, you can hand off that first round of review. Instead of manually inspecting every Dependabot pull request, you can create an automation that reviews open pull requests, groups them by risk, verifies CI status, and delivers a summary before your day begins.
这是交给 Copilot 处理的完美任务!借助 GitHub Copilot 应用自动化,你可以将第一轮审查交给它。无需手动检查每个 Dependabot 拉取请求,你可以创建一个自动化,审查开放的拉取请求,按风险分组,验证 CI 状态,并在你开始一天工作之前提供摘要。
Follow the steps below to build a daily Dependabot triage automation.
按照以下步骤构建每日 Dependabot 分流自动化。
Step 1: Create a new automation
步骤 1:创建新的自动化
From the GitHub Copilot app, create a new automation.
从 GitHub Copilot 应用中,创建一个新的自动化。
You’ll configure two things first:
你需要先配置两件事:
- Name: Give the automation a descriptive name, such as Daily Dependabot Triage.
- Trigger: Decide when it should run.
- 名称:给自动化起一个描述性名称,例如“每日 Dependabot 分流”。
- 触发器:决定何时运行。
Available trigger options include:
可用的触发器选项包括:
- Manual
- Hourly
- Daily
- Weekly
- When an issue is created
- 手动
- 每小时
- 每日
- 每周
- 当创建问题时
For recurring maintenance tasks like Dependabot reviews, a daily schedule is often a good choice. For example, you might schedule it to run before your workday begins so the results are waiting when you log in.
对于像 Dependabot 审查这样的重复性维护任务,每日计划通常是不错的选择。例如,你可以安排在一天工作开始前运行,这样当你登录时结果已经准备好了。
You can also choose whether the automation runs in the cloud or on your local machine.
你还可以选择自动化是在云端运行还是在本地机器上运行。
Step 2: Describe the task in natural language
步骤 2:用自然语言描述任务
Next, tell Copilot what you want it to do.
接下来,告诉 Copilot 你希望它做什么。
For example:
例如:
Review the open Dependabot pull requests, group them by risk, identify the safe patch and minor version updates, verify that CI is passing for each pull request, and provide a short summary of the recommended next steps.Review the open Dependabot pull requests, group them by risk, identify the safe patch and minor version updates, verify that CI is passing for each pull request, and provide a short summary of the recommended next steps.Because the prompt uses natural language, you can customize it to match your team’s workflow.
由于提示使用自然语言,你可以自定义它以适应团队的工作流程。
Step 3: Select the repository
步骤 3:选择仓库
Choose the repository or project the automation should analyze.
选择自动化应分析的仓库或项目。
Once you’ve selected the repository, create the automation.
一旦你选择了仓库,就创建自动化。
If you want to test it immediately instead of waiting for the scheduled run, choose Create and Run.
如果你想立即测试而不是等待计划运行,请选择“创建并运行”。
Step 4: Review the results
步骤 4:查看结果
When the automation finishes, Copilot returns a summary instead of a list of individual pull requests.
当自动化完成时,Copilot 会返回一个摘要,而不是单个拉取请求的列表。
For example, it might:
例如,它可能会:
- Group safe patch updates together
- Separate minor and major version upgrades
- Identify which pull requests have passing CI
- Highlight dependencies that require additional investigation
- 将安全的补丁更新分组在一起
- 区分次要和主要版本升级
- 识别哪些拉取请求已通过 CI
- 突出显示需要额外调查的依赖项
Rather than interrupting your morning with dozens of small decisions, you can quickly identify which updates are ready to merge and which deserve closer attention.
与其用几十个小决定打断你的早晨,你可以快速识别哪些更新可以合并,哪些值得更仔细关注。
Step 5: Continue the work in a Copilot session
步骤 5:在 Copilot 会话中继续工作
If one of the updates requires additional work, you can continue directly from the automation results.
如果某个更新需要额外工作,你可以直接从自动化结果中继续。
For example, if the summary identifies a major framework upgrade, you can start a new Copilot session from the results and ask Copilot to help complete the migration.
例如,如果摘要识别出主要框架升级,你可以从结果开始新的 Copilot 会话,并请求 Copilot 帮助完成迁移。
Because the session starts with the automation’s context, you don’t have to gather the information again.
由于会话以自动化的上下文开始,你不必再次收集信息。
Review previous automation runs
查看之前的自动化运行
Every automation run is saved, making it easy to see:
每次自动化运行都会被保存,便于查看:
- When it ran
- What actions it performed
- What results it produced
- 运行时间
- 执行了哪些操作
- 产生了哪些结果
Having a history of each run makes automations transparent. You can always review what happened instead of treating them as a black box.
拥有每次运行的历史记录使自动化变得透明。你始终可以回顾发生了什么,而不是将其视为黑盒。
Turn repetitive work into background work
将重复工作转化为后台工作
Dependabot triage is a good example of the kind of recurring task that’s well suited for automation. You describe the workflow once, choose when it should run, and let Copilot perform the repetitive steps automatically.
Dependabot 分类是适合自动化的重复性任务的一个好例子。你描述一次工作流程,选择运行时间,然后让 Copilot 自动执行重复步骤。
If you’re just getting started with automations, begin with a task you already perform on autopilot. Let Copilot handle the routine work so you can spend your time on the decisions that require your expertise.
如果你刚开始使用自动化,从你已经自动执行的任务开始。让 Copilot 处理日常事务,这样你就可以把时间花在需要你专业知识的决策上。
Ready to automate your next recurring task? Create your first automation in the GitHub Copilot app >
准备好自动化你的下一个重复任务了吗?在 GitHub Copilot 应用中创建你的第一个自动化 >
The post GitHub Copilot app for Beginners: Automate Dependabot pull request triage appeared first on The GitHub Blog.
面向初学者的 GitHub Copilot 应用:自动化 Dependabot 拉取请求分类一文首发于 GitHub 博客。
更进一步:量化金融体系
看懂新闻只是起点——沿量化金融路径,把它变成能交付的工程能力