Skip to content

Commit 24e8d10

Browse files
committed
feat(org-team): support notification_setting
1 parent b299886 commit 24e8d10

File tree

5 files changed

+26
-25
lines changed

5 files changed

+26
-25
lines changed

modules/org-team/README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@ This module creates following resources.
1414
| Name | Version |
1515
|------|---------|
1616
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.9 |
17-
| <a name="requirement_github"></a> [github](#requirement\_github) | >= 6.2 |
17+
| <a name="requirement_github"></a> [github](#requirement\_github) | >= 6.11 |
1818

1919
## Providers
2020

2121
| Name | Version |
2222
|------|---------|
23-
| <a name="provider_github"></a> [github](#provider\_github) | 6.2.2 |
23+
| <a name="provider_github"></a> [github](#provider\_github) | 6.11.0 |
2424

2525
## Modules
2626

@@ -42,23 +42,22 @@ No modules.
4242
| Name | Description | Type | Default | Required |
4343
|------|-------------|------|---------|:--------:|
4444
| <a name="input_name"></a> [name](#input\_name) | (Required) The name of the team. | `string` | n/a | yes |
45-
| <a name="input_code_review_auto_assignment"></a> [code\_review\_auto\_assignment](#input\_code\_review\_auto\_assignment) | (Optional) A configuration for code review auto assignment. `code_review_auto_assignment` block as defined below.<br> (Optional) `enabled` - Whether to enable code review auto assignment. Defaults to `false`.<br> (Optional) `algorithm` - The algorithm to use for code review auto assignment. Valid values are `ROUND_ROBIN` or `LOAD_BALANCE`. Defaults to `ROUND_ROBIN`.<br> (Optional) `assignment_count` - The number of reviewers to assign for each pull request.<br> (Optional) `notify_team_enabled` - Whether to notify the entire team when both a team and one or more of its members are requested for review. Defaults to `false`. | <pre>object({<br> enabled = optional(bool, false)<br> algorithm = optional(string, "ROUND_ROBIN")<br> assignment_count = optional(number)<br><br> notify_team_enabled = optional(bool, false)<br> })</pre> | `{}` | no |
46-
| <a name="input_default_maintainer_enabled"></a> [default\_maintainer\_enabled](#input\_default\_maintainer\_enabled) | (Optional) If true, adds the creating user as a default maintainer to the team. Defaults to `false`. | `bool` | `false` | no |
45+
| <a name="input_code_review_auto_assignment"></a> [code\_review\_auto\_assignment](#input\_code\_review\_auto\_assignment) | (Optional) A configuration for code review auto assignment. `code_review_auto_assignment` block as defined below.<br/> (Optional) `enabled` - Whether to enable code review auto assignment. Defaults to `false`.<br/> (Optional) `algorithm` - The algorithm to use for code review auto assignment. Valid values are `ROUND_ROBIN` or `LOAD_BALANCE`. Defaults to `ROUND_ROBIN`.<br/> (Optional) `assignment_count` - The number of reviewers to assign for each pull request.<br/> (Optional) `notify_team_enabled` - Whether to notify the entire team when both a team and one or more of its members are requested for review. Defaults to `false`. | <pre>object({<br/> enabled = optional(bool, false)<br/> algorithm = optional(string, "ROUND_ROBIN")<br/> assignment_count = optional(number)<br/><br/> notify_team_enabled = optional(bool, false)<br/> })</pre> | `{}` | no |
4746
| <a name="input_description"></a> [description](#input\_description) | (Optional) A description of the team. | `string` | `"Managed by Terraform."` | no |
48-
| <a name="input_identity_provider_team_sync"></a> [identity\_provider\_team\_sync](#input\_identity\_provider\_team\_sync) | (Optional) A configuration to manage team members using your identity provider groups. `identity_provider_team_sync` block as defined below.<br> (Optional) `enabled` - Whether to enable team synchronization between your identity provider (IdP) and your organization on GitHub. Defaults to `false`.<br> (Optional) `groups` - A set of group names to sync with the team. | <pre>object({<br> enabled = optional(bool, false)<br> groups = optional(set(string), [])<br> })</pre> | `{}` | no |
47+
| <a name="input_identity_provider_team_sync"></a> [identity\_provider\_team\_sync](#input\_identity\_provider\_team\_sync) | (Optional) A configuration to manage team members using your identity provider groups. `identity_provider_team_sync` block as defined below.<br/> (Optional) `enabled` - Whether to enable team synchronization between your identity provider (IdP) and your organization on GitHub. Defaults to `false`.<br/> (Optional) `groups` - A set of group names to sync with the team. | <pre>object({<br/> enabled = optional(bool, false)<br/> groups = optional(set(string), [])<br/> })</pre> | `{}` | no |
4948
| <a name="input_is_secret"></a> [is\_secret](#input\_is\_secret) | (Optional) If true, team is only visible to the people on the team and people with owner permissions. Defaults to `false`. | `bool` | `false` | no |
5049
| <a name="input_ldap_group_dn"></a> [ldap\_group\_dn](#input\_ldap\_group\_dn) | (Optional) The LDAP Distinguished Name of the group where membership will be synchronized. Only available in GitHub Enterprise Server. | `string` | `null` | no |
5150
| <a name="input_maintainers"></a> [maintainers](#input\_maintainers) | (Optional) A list of usernames to add users as `maintainer` role. When applied, the user will become a maintainer of the team. | `set(string)` | `[]` | no |
5251
| <a name="input_members"></a> [members](#input\_members) | (Optional) A list of usernames to add users as `member` role. When applied, the user will become a member of the team. | `set(string)` | `[]` | no |
5352
| <a name="input_membership_sync_enabled"></a> [membership\_sync\_enabled](#input\_membership\_sync\_enabled) | (Optional) Whether to sync the members of the team. Members added outside of the Terraform code will be removed. Defaults to `false`. | `bool` | `false` | no |
53+
| <a name="input_notification_enabled"></a> [notification\_enabled](#input\_notification\_enabled) | (Optional) Whether to enable notifications for the team. Defaults to `true`. | `bool` | `true` | no |
5454
| <a name="input_parent_id"></a> [parent\_id](#input\_parent\_id) | (Optional) The ID of the parent team, if this is a nested team. | `string` | `null` | no |
5555

5656
## Outputs
5757

5858
| Name | Description |
5959
|------|-------------|
6060
| <a name="output_code_review_auto_assignment"></a> [code\_review\_auto\_assignment](#output\_code\_review\_auto\_assignment) | A configuration for code review auto assignment. |
61-
| <a name="output_default_maintainer_enabled"></a> [default\_maintainer\_enabled](#output\_default\_maintainer\_enabled) | Whether to add the creating user as a default maintainer. |
6261
| <a name="output_description"></a> [description](#output\_description) | The description of the team. |
6362
| <a name="output_id"></a> [id](#output\_id) | The ID of the team. |
6463
| <a name="output_identity_provider_team_sync"></a> [identity\_provider\_team\_sync](#output\_identity\_provider\_team\_sync) | A configuration to manage team members using your identity provider groups. |
@@ -68,6 +67,7 @@ No modules.
6867
| <a name="output_members"></a> [members](#output\_members) | A list of the members of the team. |
6968
| <a name="output_name"></a> [name](#output\_name) | The name of the team. |
7069
| <a name="output_node_id"></a> [node\_id](#output\_node\_id) | The Node ID of the team. |
70+
| <a name="output_notification_enabled"></a> [notification\_enabled](#output\_notification\_enabled) | Whether notifications are enabled for the team. |
7171
| <a name="output_parent_id"></a> [parent\_id](#output\_parent\_id) | The ID of the parent team. |
7272
| <a name="output_slug"></a> [slug](#output\_slug) | The slug of the team. |
7373
<!-- END_TF_DOCS -->

modules/org-team/main.tf

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
###################################################
22
# GitHub Organization Team
33
###################################################
4-
4+
# INFO: Deprecated attributes
5+
# - `create_default_maintainer`
56
resource "github_team" "this" {
6-
name = var.name
7-
description = var.description
8-
privacy = var.is_secret ? "secret" : "closed"
7+
name = var.name
8+
description = var.description
9+
privacy = var.is_secret ? "secret" : "closed"
10+
notification_setting = var.notification_enabled ? "notifications_enabled" : "notifications_disabled"
911

10-
parent_team_id = var.parent_id
11-
create_default_maintainer = var.default_maintainer_enabled
12+
parent_team_id = var.parent_id
1213

1314
ldap_dn = var.ldap_group_dn
1415
}

modules/org-team/outputs.tf

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,16 +28,16 @@ output "is_secret" {
2828
value = var.is_secret
2929
}
3030

31+
output "notification_enabled" {
32+
description = "Whether notifications are enabled for the team."
33+
value = github_team.this.notification_setting == "notifications_enabled"
34+
}
35+
3136
output "parent_id" {
3237
description = "The ID of the parent team."
3338
value = github_team.this.parent_team_id
3439
}
3540

36-
output "default_maintainer_enabled" {
37-
description = "Whether to add the creating user as a default maintainer."
38-
value = github_team.this.create_default_maintainer
39-
}
40-
4141
output "maintainers" {
4242
description = "A list of the maintainers of the team."
4343
value = var.maintainers

modules/org-team/variables.tf

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,20 +18,20 @@ variable "is_secret" {
1818
nullable = false
1919
}
2020

21+
variable "notification_enabled" {
22+
description = "(Optional) Whether to enable notifications for the team. Defaults to `true`."
23+
type = bool
24+
default = true
25+
nullable = false
26+
}
27+
2128
variable "parent_id" {
2229
description = "(Optional) The ID of the parent team, if this is a nested team."
2330
type = string
2431
default = null
2532
nullable = true
2633
}
2734

28-
variable "default_maintainer_enabled" {
29-
description = "(Optional) If true, adds the creating user as a default maintainer to the team. Defaults to `false`."
30-
type = bool
31-
default = false
32-
nullable = false
33-
}
34-
3535
variable "maintainers" {
3636
description = "(Optional) A list of usernames to add users as `maintainer` role. When applied, the user will become a maintainer of the team."
3737
type = set(string)

modules/org-team/versions.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ terraform {
44
required_providers {
55
github = {
66
source = "integrations/github"
7-
version = ">= 6.2"
7+
version = ">= 6.11"
88
}
99
}
1010
}

0 commit comments

Comments
 (0)