community.general.github_webhook_info module – Query information about GitHub webhooks

Note

This module is part of the community.general collection (version 10.1.0).

You might already have this collection installed if you are using the ansible package. It is not included in ansible-core. To check whether it is installed, run ansible-galaxy collection list.

To install it, use: ansible-galaxy collection install community.general. You need further requirements to be able to use this module, see Requirements for details.

To use it in a playbook, specify: community.general.github_webhook_info.

Synopsis

  • Query information about GitHub webhooks

Requirements

The below requirements are needed on the host that executes this module.

  • PyGithub >= 1.3.5

Parameters

Parameter

Comments

github_url

string

Base URL of the github api

Default: "https://api.github.com"

password

string

Password to authenticate to GitHub with

repository

aliases: repo

string / required

Full name of the repository to configure a hook for

token

string

Token to authenticate to GitHub with

user

string / required

User to authenticate to GitHub as

Attributes

Attribute

Support

Description

check_mode

Support: full

This action does not modify state.

Can run in check_mode and return changed status prediction without modifying target.

diff_mode

Support: N/A

This action does not modify state.

Will return details on what has changed (or possibly needs changing in check_mode), when in diff mode.

Examples

- name: List hooks for a repository (password auth)
  community.general.github_webhook_info:
    repository: ansible/ansible
    user: "{{ github_user }}"
    password: "{{ github_password }}"
  register: ansible_webhooks

- name: List hooks for a repository on GitHub Enterprise (token auth)
  community.general.github_webhook_info:
    repository: myorg/myrepo
    user: "{{ github_user }}"
    token: "{{ github_user_api_token }}"
    github_url: https://github.example.com/api/v3/
  register: myrepo_webhooks

Return Values

Common return values are documented here, the following are the fields unique to this module:

Key

Description

hooks

list / elements=dictionary

A list of hooks that exist for the repo

Returned: always

Sample: [{"active": true, "content_type": "json", "events": ["issue_comment", "pull_request"], "has_shared_secret": true, "id": 6206, "insecure_ssl": "1", "last_response": {"code": 200, "message": "OK", "status": "active"}, "url": "https://jenkins.example.com/ghprbhook/"}]

Authors

  • Chris St. Pierre (@stpierre)