Skip to content

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

Closed

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.

Activity

  1. usmonster commented on May 20, 2021

    @usmonster
    Contributor

    Hello! Hasn't this been closed by #693?

    Also, has there been any discussion or thought of applying this as a generic pattern, i.e. accepting a slug/name anywhere an ID is currently required, wherever possible (e.g. #802)? I have a specific use case in mind, but it would be nice to do this consistently. (I might open another issue or PR if it makes sense to anyone else but myself.) Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type: Featurer/team_repository

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions