From 6c15f5aba75433fda3b5f841d744c3b2b50b4b38 Mon Sep 17 00:00:00 2001 From: tituspijean Date: Sat, 4 Sep 2021 00:13:01 +0200 Subject: [PATCH] Add check for branch to start with ci-auto-update --- run.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/run.py b/run.py index 09f2848..3b34294 100644 --- a/run.py +++ b/run.py @@ -1056,7 +1056,8 @@ async def github(request): # Nothing to do but success anyway (204 = No content) abort(204, "Nothing to do") # We only accept PRs that are created by github-action bot - if hook_infos["pull_request"]["user"]["login"] != "github-actions[bot]": + if hook_infos["pull_request"]["user"]["login"] != "github-actions[bot]" \ + or not hook_infos["pull_request"]["head"]["ref"].startswith("ci-auto-update-"): # Unauthorized abort(403, "Unauthorized") # Fetch the PR infos (yeah they ain't in the initial infos we get @_@)