Changelog¶
The changelog format is based on Keep a Changelog.
This project uses Semantic Versioning - MAJOR.MINOR.PATCH
1.0.1.dev44+gae9ff589d (2026-10-16)¶
Removed¶
Removed the unauthenticated
get_user_pubkeyshelper fromsaltext.github.utils.github. It ignored the configuredapi_url, relied onsalt.utils.httpand was not exposed in any module
Deprecated¶
Deprecated all current functions of the
github execution moduleas well as thegithub state module. Use the corresponding functions of the newgithub_organdgithub_repomodules instead. Thegithubexecution module remains the namespace for functionality that is not tied to a single organization. Thegithub.list_members_without_mfafunction and the per-team MFA enforcement ofgithub.team_presentare deprecated without replacement - require 2FA organization-wide in the GitHub settings instead
Changed¶
All API calls are now routed through the PyGithub client, honoring the configured
api_url, authentication and retry handling uniformlyException tracebacks are only logged at debug loglevel now
Refactored the GitHub API interaction layer into reusable per-entity modules below
saltext.github.utils.gh. These raiseGitHubApiError/GitHubNotFoundError(subclasses ofCommandExecutionError) instead of returning error indicators. Existing execution module functions behave as before, except that unhandled API errors now surface as the above exceptions instead of raw PyGithub ones.The execution module now exclusively relies on public PyGithub APIs instead of internal ones (
_requester,_identity,_rawData, manualPaginatedListconstruction). It also avoids deprecated API paths (/teams/{team_id}/...) by addressing teams by slug and checking team memberships via themembershipsendpoints. The minimum supported PyGithub version is now 2.2.
Fixed¶
All states now report the projected changes in test mode, matching the changes reported on actual application.
Fixed a PyGithub deprecation warning by migrating to
github.Auth.TokenauthenticationFixed compound states (
github_repo.present,github_org.team_present, environment management) reporting no changes when failing after some changes had already been appliedFixed legacy
githubstate functions rendering a traceback instead of a failed state when an unexpectedCommandExecutionErrorwas raised, e.g. caused by missing profile configurationFixed
github.add_teamrefreshing the team cache using the default profile instead of the configured oneFixed
github.get_issues,github.get_issue_comments,github.get_prsandgithub.get_milestonescrashing with anAttributeErrorwhen the API returned an error. They now raise aCommandExecutionErrorcarrying the API error message.Fixed
github.get_milestones/github.get_milestonecrashing on API payloads missing optional keysFixed
github.is_team_membercrashing with aTypeErrorwhen the team does not exist. It now returnsFalse.Fixed
github.remove_reporaising an exception instead of returningFalsefor nonexistent repositoriesFixed
github.repo_presentnot passing the configured profile when creating repositoriesFixed
github.repo_presentreporting a failed team removal when adding a repository to a team failed.Fixed
github.ruleset_absentreporting success when the ruleset could not be deleted. The module function returns a truthy error dict on failure, which was mistaken for success, and the failure result was subsequently overwritten by the “does not exist” fallback.Fixed
github.ruleset_presentdrift detection, which compared server-populated fields and iterated the wrong parameter set, and made the ruleset states report forecast changes in test modeFixed
github.team_presentcrashing when managing team members
Added¶
Added
default_branchtogithub_repo.updateand thegithub_repo.presentstateAdded
github.queryfor making direct calls to arbitrary GitHub API endpoints, transparently following paginationAdded
github.rate_limitfor querying the API rate limit status of the profile’s tokenAdded
github.revoke_app_tokenfor immediately revoking a GitHub App profile’s current installation access token (otherwise valid for one hour), e.g. as the last step of an ephemeral CI runAdded
github_user.list_keysfor listing the verified public SSH keys of any user, defaulting to the token’s user, e.g. for use with thessh_authstate moduleAdded a persistent cross-process per-connection cache (on by default, opt out via the
cacheprofile parameter), serving token/account identities and file-based custom resource grains (validated against each repository’spushed_attimestamp) without refetching, e.g. acrosssalt-call --localinvocationsAdded composite states that generate an SSH keypair in memory via the
ssh_pkimodule and distribute the public half as a deploy key and the private half as an Actions secret, with optional rotation (github_repo.deploy_key_actions_presentand the resource-typedeploy_key.actions_present)Added custom repository resource grains sourced from in-repo YAML/JSON files (e.g. copier answers) via the
grains_filesresource declaration key, with per-namespace key filtering, renaming and optional merging into the root grainsAdded management of GitHub Pages sites (
github_repo.get_pages/setup_pages/update_pages/remove_pagesand thegithub_repo.pages_present/pages_absentstates)Added management of default workflow permissions for the
GITHUB_TOKEN(github_repo.get_workflow_permissions/set_workflow_permissionsand thegithub_repo.workflow_permissions_managedstate)Added management of repository Actions secrets, encrypted client-side to the repository public key (
github_repo.list_actions_secrets/get_actions_secret/set_actions_secret/remove_actions_secretand thegithub_repo.actions_secret_present/actions_secret_absentstates)Added management of repository deploy keys (
github_repo.list_deploy_keys/get_deploy_key/add_deploy_key/remove_deploy_keyand thegithub_repo.deploy_key_present/deploy_key_absentstates)Added management of repository environments, including deployment branch policies (
github_repo.list_environments/get_environment/set_environment/remove_environment/list_deployment_branch_policies/add_deployment_branch_policy/remove_deployment_branch_policyand thegithub_repo.environment_present/environment_absentstates)Added management of repository labels (
github_repo.list_labels/get_label/add_label/edit_label/remove_labeland thegithub_repo.label_present/label_absentstates)Added native GitHub App authentication via the
app_id,private_key/private_key_pathand optionalinstallation_idandpermissionsprofile parameters. Installation access tokens are minted and refreshed automatically (optionally restricted to a subset of the app’s granted permissions), the app’s installation onowneris discovered when not pinned, and the connection identity derives from the app’s identity instead of its short-lived tokens, keeping the persistentcacheeffective across token rotation (e.g. in CI)Added scoped
github_organdgithub_repoexecution and state modules, which replace the organization- and repository-related functionality of the monolithicgithubmodules. Unlike the legacy functions, they raise errors instead of logging them and returningFalse. Collections with a unique natural key (repos, teams, team repos, labels, environments, Actions secrets) are returned as name-keyed mappings, id-addressed ones (issues, PRs, milestones, rulesets, deploy keys) as lists. All collection outputs can be reduced to specific fields via thefieldsargument. The newgithub_org.team_presentstate manages members as a simple list and drops the legacy per-team MFA enforcement options - require 2FA org-wide in the GitHub organization settings insteadAdded the optional
api_urlprofile option for targeting GitHub Enterprise Server instancesAdded the
githubSalt resource type for Salt 3008.3+, exposing each GitHub repository as an individually targetable resource with per-repository grains and repository-implicit execution and state modulesAdded
github.account_infofor looking up the public profile of any user or organization account, defaulting to the profile’s ownerAdded
github_org.infofor looking up the public profile of an organization account, defaulting to the profile’s owner and failing on usersAdded
github_user.infofor looking up the public profile of a user account, defaulting to the token’s user and failing on organizationsExtended repository information (
github_repo.info/github_repo.list, but also affects the legacygithub.get_repo_infoand the resource grains) withvisibility,archived,disabled,is_template,license,topics,custom_properties,clone_url,ssh_url,created_at,has_discussions,has_pagesandhas_projects(info additionally carriesupdated_at)Profile configuration values containing SDB URIs (e.g.
token: sdb://osenv/GITHUB_TOKEN) are now rendered on access. Salt itself only renders them inside the minion/master configuration during startup, so this makes them work in pillar-sourced profiles as well.The new modules support repositories of any owner. Profiles take an
owner(organization or user; preferred over the legacyorg_namealias), which defaults to the token’s user when unset. Repository listing and creation live on thegithub_repomodule (list/create), and all of its functions and states as well as all functions of the (now strictly organization-scoped)github_orgmodule accept a per-callowneroverride, so repositories, teams, members and rulesets of foreign organizations can be managed as well. Due to GitHub API limitations, repository creation is only supported for organizations and the authenticated user, private repositories of other users are not listable, tokens without an associated user account (e.g. GitHub App installation tokens) require an explicitownerand teams always belong to an organizationThe new
github_organdgithub_repostates report machine-readablechangesdictionaries (created/deleted/updatedentity names,old/newsetting mappings and*_added/*_removedname lists) instead of prose
v1.0.0 (2024-08-13)¶
Initial release of saltext-github. This release mostly tracks the functionality in the core Salt code base as of version 3007.1.
Added¶
Add CRUD funtionality for Github rulesets #11