Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

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?

like image 261
Mohamed Amer Avatar asked Sep 12 '25 14:09

Mohamed Amer


1 Answers

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". 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.

RequireBranchesBeUpToDate

like image 73
jt11 Avatar answered Sep 15 '25 03:09

jt11