@@ -8,54 +8,8 @@ import (
88 "github.com/google/go-github/v82/github"
99 "github.com/hashicorp/terraform-plugin-log/tflog"
1010 "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
11- "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation"
1211)
1312
14- func requiredReviewersSchema () * schema.Schema {
15- return & schema.Schema {
16- Type : schema .TypeList ,
17- Optional : true ,
18- Description : "Require specific reviewers to approve pull requests targeting matching branches. Note: This feature is in beta and subject to change." ,
19- Elem : & schema.Resource {
20- Schema : map [string ]* schema.Schema {
21- "reviewer" : {
22- Type : schema .TypeList ,
23- Required : true ,
24- MaxItems : 1 ,
25- Description : "The reviewer that must review matching files." ,
26- Elem : & schema.Resource {
27- Schema : map [string ]* schema.Schema {
28- "id" : {
29- Type : schema .TypeInt ,
30- Required : true ,
31- Description : "The ID of the reviewer that must review." ,
32- },
33- "type" : {
34- Type : schema .TypeString ,
35- Required : true ,
36- ValidateDiagFunc : toDiagFunc (validation .StringInSlice ([]string {"Team" }, false ), "type" ),
37- Description : "The type of reviewer. Currently only `Team` is supported." ,
38- },
39- },
40- },
41- },
42- "file_patterns" : {
43- Type : schema .TypeList ,
44- Required : true ,
45- MinItems : 1 ,
46- Description : "File patterns (fnmatch syntax) that this reviewer must approve." ,
47- Elem : & schema.Schema {Type : schema .TypeString },
48- },
49- "minimum_approvals" : {
50- Type : schema .TypeInt ,
51- Required : true ,
52- Description : "Minimum number of approvals required from this reviewer. Set to 0 to make approval optional." ,
53- },
54- },
55- },
56- }
57- }
58-
5913// Helper function to safely convert interface{} to int, handling both int and float64.
6014func toInt (v any ) int {
6115 switch val := v .(type ) {
0 commit comments