benschubert.infrastructure.github_content module – Get the content of a file or directory on GitHub
Note
This module is part of the benschubert.infrastructure collection (version 0.0.1).
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 benschubert.infrastructure
.
To use it in a playbook, specify: benschubert.infrastructure.github_content
.
Synopsis
This module allows retrieving the metadata on content of a file or a directory of a project on GitHub through the GitHub API. Documentation on the API can be found at https://docs.github.com/en/rest/repos/contents
Parameters
Parameter |
Comments |
---|---|
The owner of the repository |
|
The path inside the repository for the file or directory |
|
The branch/tag/git id for which to get the path |
|
The repository name |
Examples
- name: Get the license file info for the ansible repo
github_content:
owner: ansible
path: COPYING
ref: devel
repo: ansible
register: _ansible_license
Return Values
Common return values are documented here, the following are the fields unique to this module:
Key |
Description |
---|---|
The information returned by the GitHub content API Returned: always Sample: |
|
Information on what happen Returned: always Sample: |