community.general.github_webhook_facts (0.1.4) — module

Query information about GitHub webhooks

Authors: Chris St. Pierre (@stpierre)

Install collection

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


Add to requirements.yml

  collections:
    - name: community.general
      version: 0.1.4

Description

Query information about GitHub webhooks

This module was called C(github_webhook_facts) before Ansible 2.9. The usage did not change.


Requirements

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: List hooks for a repository (password auth)
  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)
  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

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

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

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

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

Outputs

hooks:
  description: A list of hooks that exist for the repo
  returned: always
  sample: "[{\"has_shared_secret\": true,\n  \"url\": \"https://jenkins.example.com/ghprbhook/\"\
    ,\n  \"events\": [\"issue_comment\", \"pull_request\"],\n  \"insecure_ssl\": \"\
    1\",\n  \"content_type\": \"json\",\n  \"active\": true,\n  \"id\": 6206,\n  \"\
    last_response\": {\"status\": \"active\", \"message\": \"OK\", \"code\": 200}}]\n"
  type: list