github_webhook: Fix create of new hook with existing hooks (#54458)
When creating a new webhook with existing hooks already in place, the module would erroneously select one of the existing hooks to update instead of creating the hook anew. This fixes that bug.
This commit is contained in:
parent
f242f3475e
commit
0943e2a0df
1 changed files with 2 additions and 0 deletions
|
@ -255,6 +255,8 @@ def main():
|
|||
for hook in repo.get_hooks():
|
||||
if hook.config.get("url") == module.params["url"]:
|
||||
break
|
||||
else:
|
||||
hook = None
|
||||
except github.GithubException as err:
|
||||
module.fail_json(msg="Unable to get hooks from repository %s: %s" % (
|
||||
module.params["repository"], to_native(err)))
|
||||
|
|
Loading…
Reference in a new issue