community.general.github_secrets_info module – List GitHub repository or organization secrets

Note

This module is part of the community.general collection (version 12.5.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.

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

New in community.general 12.5.0

Synopsis

  • List secrets in a GitHub repository or organization.

Parameters

Parameter

Comments

api_url

string

The base URL for the GitHub API.

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

organization

aliases: org, username

string / required

The GitHub username or organization name.

repository

aliases: repo

string

The name of the repository.

If not provided, the listing will be at organization level.

token

string / required

The GitHub token used for authentication.

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.

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

Examples

- name: List Github secret
  community.general.github_secrets_info:
    token: "{{ lookup('ansible.builtin.env', 'GITHUB_TOKEN') }}"
    repository: "ansible"
    organization: "ansible"

Return Values

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

Key

Description

secrets

list / elements=dictionary

The list of currently existing secrets.

Returned: success

Sample: [{"created_at": "2026-01-11T23:19:00Z", "name": "ANSIBLE", "updated_at": "2026-02-15T22:18:16Z"}]

created_at

string

The date and time when the secret was created.

Returned: success

name

string

The name of the secret.

Returned: success

updated_at

string

The date and time when the secret was last updated.

Returned: success

Authors

  • Thomas Sjögren (@konstruktoid)