File tree Expand file tree Collapse file tree 2 files changed +25
-0
lines changed Expand file tree Collapse file tree 2 files changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -128,6 +128,29 @@ def run(self):
128128 events .dispatcher .dispatch ("prbuilder" , status_evt )
129129 continue
130130
131+ if cfg .github .required_commits and repo in cfg .github .required_commits :
132+ required_commit = getattr (cfg .github .required_commits , repo )
133+
134+ compare_url = pr ["head" ]["repo" ]["compare_url" ]
135+ compare_result = requests .get (
136+ compare_url .format (base = required_commit , head = pr ["head" ]["ref" ])
137+ ).json ()
138+
139+ if not compare_result ["status" ] in ["ahead" , "identical" ]:
140+ status_evt = events .BuildStatus (
141+ repo ,
142+ head_sha ,
143+ shortrev ,
144+ "default" ,
145+ pr_id ,
146+ False ,
147+ False ,
148+ "" ,
149+ "PR branch is too out-of-date, please rebase." ,
150+ )
151+ events .dispatcher .dispatch ("prbuilder" , status_evt )
152+ continue
153+
131154 # mergeable can be None!
132155 if pr ["mergeable" ] is False :
133156 status_evt = events .BuildStatus (
Original file line number Diff line number Diff line change @@ -40,6 +40,8 @@ github:
4040 refresh_interval : 600
4141 hook_hmac_secret : SECRET
4242 rebuild_command : " @dolphin-emu-bot rebuild"
43+ required_commits :
44+ dolphin-emu/dolphin : deadbeef
4345
4446buildbot :
4547 url : https://dolphin.ci/
You can’t perform that action at this time.
0 commit comments