Skip to content

github_team_members - new module for managing team membership#11706

Open
john-westcott-iv wants to merge 1 commit intoansible-collections:mainfrom
john-westcott-iv:github_team_members
Open

github_team_members - new module for managing team membership#11706
john-westcott-iv wants to merge 1 commit intoansible-collections:mainfrom
john-westcott-iv:github_team_members

Conversation

@john-westcott-iv
Copy link
Copy Markdown
Contributor

SUMMARY

New module github_team_members for managing team membership in GitHub organizations.

Features:

  • Three state modes:
    • present — ensure listed members are on the team (additive, does not remove others)
    • absent — ensure listed members are NOT on the team (subtractive)
    • exact — make team membership exactly match the provided list (adds missing, removes extras, corrects roles)
  • Members can be specified as bare strings (default role: member) or dicts with username and role
  • Supports member and maintainer roles
  • Returns added, removed, updated, and final members lists
  • Full check mode support
  • Uses PyGithub
ISSUE TYPE
  • New Module Pull Request
COMPONENT NAME

github_team_members

ADDITIONAL INFORMATION
  • Unit tests covering all three state modes, idempotency, role updates, and the normalize helper
  • BOTMETA entry added
  • Companion to github_team module (manages team CRUD)

🤖 Generated with Claude Code

Add a new module to manage team membership in GitHub organizations using
PyGithub. Supports three state modes: present (additive), absent
(subtractive), and exact (declarative sync). Members can be specified as
bare usernames or dicts with username and role.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@ansibullbot
Copy link
Copy Markdown
Collaborator

The test ansible-test sanity --test validate-modules [explain] failed with 3 errors:

plugins/modules/github_team_members.py:0:0: invalid-documentation-markup: Directive "O(members[].role)" contains a non-existing option "members[].role"
plugins/modules/github_team_members.py:0:0: invalid-documentation-markup: Directive "O(members[].username)" contains a non-existing option "members[].username"
plugins/modules/github_team_members.py:0:0: module-invalid-version-added: DOCUMENTATION: version_added ('NEXT_PATCH') is not a valid collection version (see specification at https://semver.org/): invalid semantic version 'NEXT_PATCH'. Got {'module': 'github_team_members', 'short_description': 'Manage team membership on Github organizations', 'version_added': 'NEXT_PATCH', 'description': ['Manage the members of a team in a Github organization using the PyGithub library.', 'Supports adding, removing, and synchronizing team members with three state modes.', 'Authentication can be done with O(access_token) or with O(username) and O(password).'], 'attributes': {'check_mode': {'description': 'Can run in C(check_mode) and return chan...

The test ansible-test sanity --test validate-modules [explain] failed with 3 errors:

plugins/modules/github_team_members.py:0:0: invalid-documentation-markup: Directive "O(members[].role)" contains a non-existing option "members[].role"
plugins/modules/github_team_members.py:0:0: invalid-documentation-markup: Directive "O(members[].username)" contains a non-existing option "members[].username"
plugins/modules/github_team_members.py:0:0: module-invalid-version-added: DOCUMENTATION: version_added ('NEXT_PATCH') is not a valid collection version (see specification at https://semver.org/): invalid semantic version 'NEXT_PATCH'. Got {'module': 'github_team_members', 'short_description': 'Manage team membership on Github organizations', 'version_added': 'NEXT_PATCH', 'description': ['Manage the members of a team in a Github organization using the PyGithub library.', 'Supports adding, removing, and synchronizing team members with three state modes.', 'Authentication can be done with O(access_token) or with O(username) and O(password).'], 'attributes': {'check_mode': {'description': 'Can run in C(check_mode) and return chan...

The test ansible-test sanity --test validate-modules [explain] failed with 3 errors:

plugins/modules/github_team_members.py:0:0: invalid-documentation-markup: Directive "O(members[].role)" contains a non-existing option "members[].role"
plugins/modules/github_team_members.py:0:0: invalid-documentation-markup: Directive "O(members[].username)" contains a non-existing option "members[].username"
plugins/modules/github_team_members.py:0:0: module-invalid-version-added: DOCUMENTATION: version_added ('NEXT_PATCH') is not a valid collection version (see specification at https://semver.org/): invalid semantic version 'NEXT_PATCH'. Got {'module': 'github_team_members', 'short_description': 'Manage team membership on Github organizations', 'version_added': 'NEXT_PATCH', 'description': ['Manage the members of a team in a Github organization using the PyGithub library.', 'Supports adding, removing, and synchronizing team members with three state modes.', 'Authentication can be done with O(access_token) or with O(username) and O(password).'], 'attributes': {'check_mode': {'description': 'Can run in C(check_mode) and return chan...

The test ansible-test sanity --test validate-modules [explain] failed with 3 errors:

plugins/modules/github_team_members.py:0:0: invalid-documentation-markup: Directive "O(members[].role)" contains a non-existing option "members[].role"
plugins/modules/github_team_members.py:0:0: invalid-documentation-markup: Directive "O(members[].username)" contains a non-existing option "members[].username"
plugins/modules/github_team_members.py:0:0: module-invalid-version-added: DOCUMENTATION: version_added ('NEXT_PATCH') is not a valid collection version (see specification at https://semver.org/): invalid semantic version 'NEXT_PATCH'. Got {'module': 'github_team_members', 'short_description': 'Manage team membership on Github organizations', 'version_added': 'NEXT_PATCH', 'description': ['Manage the members of a team in a Github organization using the PyGithub library.', 'Supports adding, removing, and synchronizing team members with three state modes.', 'Authentication can be done with O(access_token) or with O(username) and O(password).'], 'attributes': {'check_mode': {'description': 'Can run in C(check_mode) and return chan...

click here for bot help

@ansibullbot
Copy link
Copy Markdown
Collaborator

@ansibullbot ansibullbot added ci_verified Push fixes to PR branch to re-run CI module module needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR new_plugin New plugin plugins plugin (any type) tests tests unit tests/unit labels Mar 29, 2026
Copy link
Copy Markdown
Collaborator

@russoz russoz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as in previous PR.

@felixfontein felixfontein added check-before-release PR will be looked at again shortly before release and merged if possible. backport-12 Automatically create a backport for the stable-12 branch labels Mar 30, 2026
@ansibullbot ansibullbot added the stale_ci CI is older than 7 days, rerun before merging label Apr 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport-12 Automatically create a backport for the stable-12 branch check-before-release PR will be looked at again shortly before release and merged if possible. ci_verified Push fixes to PR branch to re-run CI module module needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR new_plugin New plugin plugins plugin (any type) stale_ci CI is older than 7 days, rerun before merging tests tests unit tests/unit

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants