diff --git a/github/data_source_github_team.go b/github/data_source_github_team.go index ea1ca66c39..d83ff1a860 100644 --- a/github/data_source_github_team.go +++ b/github/data_source_github_team.go @@ -43,9 +43,10 @@ func dataSourceGithubTeam() *schema.Resource { Elem: &schema.Schema{Type: schema.TypeString}, }, "repositories": { - Type: schema.TypeList, - Computed: true, - Elem: &schema.Schema{Type: schema.TypeString}, + Deprecated: "Use repositories_detailed instead.", + Type: schema.TypeList, + Computed: true, + Elem: &schema.Schema{Type: schema.TypeString}, }, "repositories_detailed": { Type: schema.TypeList, @@ -56,6 +57,10 @@ func dataSourceGithubTeam() *schema.Resource { Type: schema.TypeInt, Computed: true, }, + "repo_name": { + Type: schema.TypeString, + Computed: true, + }, "role_name": { Type: schema.TypeString, Computed: true, @@ -168,7 +173,7 @@ func dataSourceGithubTeamRead(d *schema.ResourceData, meta interface{}) error { } } - repositories_detailed = make([]interface{}, 0, resultsPerPage) //removed this from the loop + repositories_detailed = make([]interface{}, 0, resultsPerPage) // removed this from the loop for { repository, resp, err := client.Teams.ListTeamReposByID(ctx, orgId, team.GetID(), &options.ListOptions) @@ -180,6 +185,7 @@ func dataSourceGithubTeamRead(d *schema.ResourceData, meta interface{}) error { repositories = append(repositories, v.GetName()) repositories_detailed = append(repositories_detailed, map[string]interface{}{ "repo_id": v.GetID(), + "repo_name": v.GetName(), "role_name": v.GetRoleName(), }) } diff --git a/website/docs/d/team.html.markdown b/website/docs/d/team.html.markdown index 85ded315b8..fdfca6f9dc 100644 --- a/website/docs/d/team.html.markdown +++ b/website/docs/d/team.html.markdown @@ -33,5 +33,5 @@ data "github_team" "example" { * `privacy` - the team's privacy type. * `permission` - the team's permission level. * `members` - List of team members (list of GitHub usernames). Not returned if `summary_only = true` -* `repositories` - List of team repositories (list of repo names). Not returned if `summary_only = true` -* `repositories_detailed` - List of team repositories (list of `repo_id` and [`role_name`](https://registry.terraform.io/providers/integrations/github/latest/docs/resources/team_repository#permission)). Not returned if `summary_only = true` +* `repositories` - (**DEPRECATED**) List of team repositories (list of repo names). Not returned if `summary_only = true` +* `repositories_detailed` - List of team repositories (each item comprises of `repo_id`, `repo_name` & [`role_name`](https://registry.terraform.io/providers/integrations/github/latest/docs/resources/team_repository#permission)). Not returned if `summary_only = true`