Skip to content

Modify github_team_repository to accept team slug as well as team id #675

@k24dizzle

Description

@k24dizzle

We have a use case where we would like users to add teams to their repos, and having them being able to do so through a slug rather than an id would make the configuration more readable.

Would it be feasible to modify the github_team_repository resource to take in a team slug rather than a team id?
https://registry.terraform.io/providers/integrations/github/latest/docs/resources/team_repository

This would be a similar change to the github_branch_protection resource taking in either a Node ID or name of a repository.

I was thinking about adding a piece of logic that would try to find the team ID if the given team ID is not an integer (in which case we assume that the user has passed in a slug instead of an ID).

*There is an edge case where a user tries to add a team repository resource with a team name composed of an integer (123), in which case the provider would assume that the user passed in a team id rather than a team slug.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions