Use rpartition
to either get the last part of a ref/head/branch
ref or just
`branch` (github)
This commit is contained in:
parent
fcbb530b9e
commit
756938a4c9
1 changed files with 1 additions and 4 deletions
|
@ -250,10 +250,7 @@ class Module(ModuleManager.BaseModule):
|
|||
|
||||
branch = None
|
||||
if "ref" in data:
|
||||
if "/" in data["ref"]:
|
||||
branch = data["ref"].split("/", 2)[2]
|
||||
else:
|
||||
branch = data["ref"]
|
||||
_, _, branch = data["ref"].rpartition("/")
|
||||
|
||||
hooks = self.bot.database.channel_settings.find_by_setting(
|
||||
"github-hooks")
|
||||
|
|
Loading…
Reference in a new issue