Skip to content

Commit bb9bc27

Browse files
committed
fix: Fixed team data source detailed repos
Signed-off-by: Steve Hipwell <[email protected]>
1 parent 4b77944 commit bb9bc27

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

github/data_source_github_team.go

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,10 @@ func dataSourceGithubTeam() *schema.Resource {
4343
Elem: &schema.Schema{Type: schema.TypeString},
4444
},
4545
"repositories": {
46-
Type: schema.TypeList,
47-
Computed: true,
48-
Elem: &schema.Schema{Type: schema.TypeString},
46+
Deprecated: "Use repositories_detailed instead.",
47+
Type: schema.TypeList,
48+
Computed: true,
49+
Elem: &schema.Schema{Type: schema.TypeString},
4950
},
5051
"repositories_detailed": {
5152
Type: schema.TypeList,
@@ -56,6 +57,10 @@ func dataSourceGithubTeam() *schema.Resource {
5657
Type: schema.TypeInt,
5758
Computed: true,
5859
},
60+
"repo_name": {
61+
Type: schema.TypeString,
62+
Computed: true,
63+
},
5964
"role_name": {
6065
Type: schema.TypeString,
6166
Computed: true,
@@ -168,7 +173,7 @@ func dataSourceGithubTeamRead(d *schema.ResourceData, meta interface{}) error {
168173
}
169174
}
170175

171-
repositories_detailed = make([]interface{}, 0, resultsPerPage) //removed this from the loop
176+
repositories_detailed = make([]interface{}, 0, resultsPerPage) // removed this from the loop
172177

173178
for {
174179
repository, resp, err := client.Teams.ListTeamReposByID(ctx, orgId, team.GetID(), &options.ListOptions)
@@ -180,6 +185,7 @@ func dataSourceGithubTeamRead(d *schema.ResourceData, meta interface{}) error {
180185
repositories = append(repositories, v.GetName())
181186
repositories_detailed = append(repositories_detailed, map[string]interface{}{
182187
"repo_id": v.GetID(),
188+
"repo_name": v.GetName(),
183189
"role_name": v.GetRoleName(),
184190
})
185191
}

website/docs/d/team.html.markdown

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,5 +33,5 @@ data "github_team" "example" {
3333
* `privacy` - the team's privacy type.
3434
* `permission` - the team's permission level.
3535
* `members` - List of team members (list of GitHub usernames). Not returned if `summary_only = true`
36-
* `repositories` - List of team repositories (list of repo names). Not returned if `summary_only = true`
37-
* `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`
36+
* `repositories` - (**DEPRECATED**) List of team repositories (list of repo names). Not returned if `summary_only = true`
37+
* `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`

0 commit comments

Comments
 (0)