mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-04-01 00:03:10 +00:00
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:
committed by
ansibot
parent
f242f3475e
commit
0943e2a0df
@@ -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)))
|
||||
|
||||
Reference in New Issue
Block a user