community.general.github_webhook_info (8.5.0) — module

Query information about GitHub webhooks

Authors: Chris St. Pierre (@stpierre)

Install collection

Install with ansible-galaxy collection install community.general:==8.5.0


Add to requirements.yml

  collections:
    - name: community.general
      version: 8.5.0

Description

Query information about GitHub webhooks


Requirements

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- 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
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- 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

Inputs

    
user:
    description:
    - User to authenticate to GitHub as
    required: true
    type: str

token:
    description:
    - Token to authenticate to GitHub with
    required: false
    type: str

password:
    description:
    - Password to authenticate to GitHub with
    required: false
    type: str

github_url:
    default: https://api.github.com
    description:
    - Base URL of the github api
    required: false
    type: str

repository:
    aliases:
    - repo
    description:
    - Full name of the repository to configure a hook for
    required: true
    type: str

Outputs

hooks:
  description: A list of hooks that exist for the repo
  elements: dict
  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/
  type: list