ITADN

feature: add automatic rebase workflow for Pull Requests

#4308Openxuxiaowei-com-cn 创建于 2026-04-20
我们鼓励使用英文,如果不能直接使用,可以使用翻译软件,您仍旧可以保留中文原文。另外请按照如下要求提交相关信息节省社区维护同学的理解成本,否则该讨论极有可能直接被忽视或关闭。 We recommend using English. If you are non-native English speaker, you can use the translation software. In addition, please submit relevant information according to the following requirements to save the understanding cost of community maintenances, otherwise the discussion is very likely to be ignored or closed directly. **Which Component** CI / GitHub Actions **Is your feature request related to a problem? Please describe.** - 目前,要将拉取请求更新为最新的目标分支更改或压缩提交,需要维护者或贡献者手动拉取代码、在本地变基并强制推送。这个过程繁琐、耗时,并且会中断代码审查工作流。 - Currently, updating pull requests with the latest target branch changes or squashing commits requires maintainers or contributors to manually pull the code, rebase locally, and force push. This process is tedious, time-consuming, and interrupts the code review workflow. **Describe the solution you'd like** - 我希望引入一个自动变基的 GitHub Actions 工作流。当维护者或贡献者在拉取请求中评论 `/rebase` 或 `/autosquash` 时,将触发一个工作流,自动将 PR 分支针对目标分支进行变基。这可以通过使用 `cirrus-actions/rebase` 操作来实现,从而显著简化 PR 更新流程,并帮助保持干净、线性的提交历史。 - I would like to introduce an automatic rebase GitHub Actions workflow. When a maintainer or contributor comments `/rebase` or `/autosquash` on a Pull Request, it will trigger a workflow to automatically rebase the PR branch against the target branch. This can be achieved by using the `cirrus-actions/rebase` action, which significantly simplifies the PR updating process and helps maintain a clean, linear commit history. **Describe alternatives you've considered** A clear and concise description of any alternative solutions or features you've considered. - **手动本地变基:** 继续要求贡献者手动变基并强制推送,但这有较高的门槛并增加了额外负担。 - **GitHub 原生的“更新分支”按钮:** 虽然易于使用,但默认会创建一个合并提交,而不是干净的变基,并且它本身不支持通过评论实现的 `/autosquash` 功能。 - **Manual local rebasing:** Continue to ask contributors to manually rebase and force push, but this has a higher barrier and adds overhead. - **GitHub's native "Update branch" button:** While easy to use, it creates a merge commit by default rather than a clean rebase, and it doesn't support the `/autosquash` functionality natively via comments. **Additional context** Add any other context or screenshots about the feature request here.
1 条评论