[英]How to rerun Github Actions workflow when the pull request base branch updated
Is it possible to trigger Github Actions workflow when the base branch of the pull request has new code pushed?当 pull request 的基础分支有新代码推送时,是否可以触发 Github Actions 工作流程?
Details with example: the pull request branch is feature1 and the base is development, so is it possible to trigger workflow on PR for feature1 branch when the development branch updated with new code after the PR opened?详细示例:pull request 分支是 feature1,base 是 development,那么当 PR 打开后 development 分支更新了新代码时,是否可以在 feature1 分支上触发 PR 上的工作流?
There is not currently a trigger that would allow you do this.目前没有允许您执行此操作的触发器。 However, there is a feature of GitHub's branch protection rule intended to solve this problem: When selecting to "Require Status Checks to pass before merging" there is the additional option to "Require branches to be up to date before merging".但是,GitHub的分支保护规则有一个特征,旨在解决此问题:选择“需要状态检查之前要通过之前”合并时,还有一个其他选项可以“要求分支在合并之前是最新的”。 This setting will block merges if commits from the base branch are not merged back into feature branches.如果来自基本分支的提交未合并回功能分支,则此设置将阻止合并。 As a consequence users will be forced to "update" their branch which will result in a "push" event to their branch thus triggering the workflows.结果,用户将被迫“更新”他们的分支,这将导致“推送”事件到他们的分支,从而触发工作流。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.