Skip to content

Commit

Permalink
Adding releases events option to gitlab_hook module (ansible-collecti…
Browse files Browse the repository at this point in the history
…ons#7956)

* Adding releases events option to gitlab_hook module

* Fixing typo in documentation for gitlab_hook module

* No default value for releases_events

* Adding changelog fragment
  • Loading branch information
pixslx authored Feb 18, 2024
1 parent 001292c commit 1dd697b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
minor_changes:
- gitlab_hook - adds ``releases_events`` parameter for supporting Releases events triggers on GitLab hooks (https://github.com/ansible-collections/community.general/pull/7956).
10 changes: 10 additions & 0 deletions plugins/modules/gitlab_hook.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,11 @@
- Trigger hook on wiki events.
type: bool
default: false
releases_events:
description:
- Trigger hook on release events.
type: bool
version_added: '8.4.0'
hook_validate_certs:
description:
- Whether GitLab will do SSL verification when triggering the hook.
Expand Down Expand Up @@ -201,6 +206,7 @@ def create_or_update_hook(self, project, hook_url, options):
'job_events': options['job_events'],
'pipeline_events': options['pipeline_events'],
'wiki_page_events': options['wiki_page_events'],
'releases_events': options['releases_events'],
'enable_ssl_verification': options['enable_ssl_verification'],
'token': options['token'],
})
Expand All @@ -216,6 +222,7 @@ def create_or_update_hook(self, project, hook_url, options):
'job_events': options['job_events'],
'pipeline_events': options['pipeline_events'],
'wiki_page_events': options['wiki_page_events'],
'releases_events': options['releases_events'],
'enable_ssl_verification': options['enable_ssl_verification'],
'token': options['token'],
})
Expand Down Expand Up @@ -302,6 +309,7 @@ def main():
job_events=dict(type='bool', default=False),
pipeline_events=dict(type='bool', default=False),
wiki_page_events=dict(type='bool', default=False),
releases_events=dict(type='bool', default=None),
hook_validate_certs=dict(type='bool', default=False, aliases=['enable_ssl_verification']),
token=dict(type='str', no_log=True),
))
Expand Down Expand Up @@ -339,6 +347,7 @@ def main():
job_events = module.params['job_events']
pipeline_events = module.params['pipeline_events']
wiki_page_events = module.params['wiki_page_events']
releases_events = module.params['releases_events']
enable_ssl_verification = module.params['hook_validate_certs']
hook_token = module.params['token']

Expand Down Expand Up @@ -369,6 +378,7 @@ def main():
"job_events": job_events,
"pipeline_events": pipeline_events,
"wiki_page_events": wiki_page_events,
"releases_events": releases_events,
"enable_ssl_verification": enable_ssl_verification,
"token": hook_token,
}):
Expand Down

0 comments on commit 1dd697b

Please sign in to comment.