community.general.github_issue (8.5.0) — module

View GitHub issue

Authors: Abhijeet Kasurde (@Akasurde)

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

View GitHub issue for a given repository and organization.

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Check if GitHub issue is closed or not
  community.general.github_issue:
    organization: ansible
    repo: ansible
    issue: 23642
    action: get_status
  register: r
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Take action depending upon issue status
  ansible.builtin.debug:
    msg: Do something when issue 23642 is open
  when: r.issue_status == 'open'

Inputs

    
repo:
    description:
    - Name of repository from which issue needs to be retrieved.
    required: true
    type: str

issue:
    description:
    - Issue number for which information is required.
    required: true
    type: int

action:
    choices:
    - get_status
    default: get_status
    description:
    - Get various details about issue depending upon action specified.
    type: str

organization:
    description:
    - Name of the GitHub organization in which the repository is hosted.
    required: true
    type: str

Outputs

issue_status:
  description: State of the GitHub issue
  returned: success
  sample: open, closed
  type: str