github¶
Connection module for the github resource type, which manages
GitHub repositories as Salt resources (requires Salt 3008.3+).
Added in version 1.1.0.
Each resource is a single repository, identified by owner/repo
(e.g. the SRN github:my-org/my-repo). Jobs dispatched to a resource
run the per-type execution and state modules shipped in this package’s
modules/states directories, which operate on the targeted
repository implicitly.
Configuration¶
The resource type is declared in the managing minion’s pillar, under
the subtree selected by resource_pillar_key (default
resources):
resources:
github:
profile: github
owners:
- my-org
The declaration keys (resource:profile, resource:owners,
resource:repos/resource:exclude patterns,
resource:include_archived and resource:grains_files
for custom grains sourced from in-repo YAML/JSON files) are described in
the configuration guide.
owners may be a mapping, overriding any of the other declaration
keys per owner:
resources:
github:
owners:
my-github-handle:
exclude:
- not-this
my-org:
repos:
- foo*
other-org:
profile: other_github_org
- saltext.github.resources.github.init(opts)[source]¶
Initialize the
githubresource type for this minion.Validates that all declared profiles (the default one and any per-owner overrides) carry a token (without contacting the API), validates any
grains_filesdeclarations and records the type-level state in__context__.
- saltext.github.resources.github.initialized()[source]¶
Return whether
init()has been called successfully for this resource type.
- saltext.github.resources.github.discover(opts)[source]¶
Return the
owner/repoIDs of the repositories this minion manages: all repositories of the declared owners, filtered by therepos/excludepatterns and theinclude_archivedflag, each of which can be overridden per owner.
- saltext.github.resources.github.grains()[source]¶
Return the grains of the current resource: the repository’s identity and basic metadata, merged with any custom grains sourced from in-repo files per the declaration’s
grains_fileskey.
- saltext.github.resources.github.grains_refresh()[source]¶
Return freshly fetched grains for the current resource, bypassing cached repository information and file contents.
- saltext.github.resources.github.ping()[source]¶
Return whether the current resource’s repository is reachable via the API.
- saltext.github.resources.github.shutdown(opts)[source]¶
Tear down the
githubresource type, dropping the type-level state from__context__.