@@ -35,11 +35,20 @@ func resourceGitlabProjectHook() *schema.Resource {
35
35
Optional : true ,
36
36
Default : true ,
37
37
},
38
+ "push_events_branch_filter" : {
39
+ Type : schema .TypeString ,
40
+ Optional : true ,
41
+ },
38
42
"issues_events" : {
39
43
Type : schema .TypeBool ,
40
44
Optional : true ,
41
45
Default : false ,
42
46
},
47
+ "confidential_issues_events" : {
48
+ Type : schema .TypeBool ,
49
+ Optional : true ,
50
+ Default : false ,
51
+ },
43
52
"merge_requests_events" : {
44
53
Type : schema .TypeBool ,
45
54
Optional : true ,
@@ -55,6 +64,11 @@ func resourceGitlabProjectHook() *schema.Resource {
55
64
Optional : true ,
56
65
Default : false ,
57
66
},
67
+ "confidential_note_events" : {
68
+ Type : schema .TypeBool ,
69
+ Optional : true ,
70
+ Default : false ,
71
+ },
58
72
"job_events" : {
59
73
Type : schema .TypeBool ,
60
74
Optional : true ,
@@ -70,6 +84,11 @@ func resourceGitlabProjectHook() *schema.Resource {
70
84
Optional : true ,
71
85
Default : false ,
72
86
},
87
+ "deployment_events" : {
88
+ Type : schema .TypeBool ,
89
+ Optional : true ,
90
+ Default : false ,
91
+ },
73
92
"enable_ssl_verification" : {
74
93
Type : schema .TypeBool ,
75
94
Optional : true ,
@@ -83,16 +102,20 @@ func resourceGitlabProjectHookCreate(d *schema.ResourceData, meta interface{}) e
83
102
client := meta .(* gitlab.Client )
84
103
project := d .Get ("project" ).(string )
85
104
options := & gitlab.AddProjectHookOptions {
86
- URL : gitlab .String (d .Get ("url" ).(string )),
87
- PushEvents : gitlab .Bool (d .Get ("push_events" ).(bool )),
88
- IssuesEvents : gitlab .Bool (d .Get ("issues_events" ).(bool )),
89
- MergeRequestsEvents : gitlab .Bool (d .Get ("merge_requests_events" ).(bool )),
90
- TagPushEvents : gitlab .Bool (d .Get ("tag_push_events" ).(bool )),
91
- NoteEvents : gitlab .Bool (d .Get ("note_events" ).(bool )),
92
- JobEvents : gitlab .Bool (d .Get ("job_events" ).(bool )),
93
- PipelineEvents : gitlab .Bool (d .Get ("pipeline_events" ).(bool )),
94
- WikiPageEvents : gitlab .Bool (d .Get ("wiki_page_events" ).(bool )),
95
- EnableSSLVerification : gitlab .Bool (d .Get ("enable_ssl_verification" ).(bool )),
105
+ URL : gitlab .String (d .Get ("url" ).(string )),
106
+ PushEvents : gitlab .Bool (d .Get ("push_events" ).(bool )),
107
+ PushEventsBranchFilter : gitlab .String (d .Get ("push_events_branch_filter" ).(string )),
108
+ IssuesEvents : gitlab .Bool (d .Get ("issues_events" ).(bool )),
109
+ ConfidentialIssuesEvents : gitlab .Bool (d .Get ("confidential_issues_events" ).(bool )),
110
+ MergeRequestsEvents : gitlab .Bool (d .Get ("merge_requests_events" ).(bool )),
111
+ TagPushEvents : gitlab .Bool (d .Get ("tag_push_events" ).(bool )),
112
+ NoteEvents : gitlab .Bool (d .Get ("note_events" ).(bool )),
113
+ ConfidentialNoteEvents : gitlab .Bool (d .Get ("confidential_note_events" ).(bool )),
114
+ JobEvents : gitlab .Bool (d .Get ("job_events" ).(bool )),
115
+ PipelineEvents : gitlab .Bool (d .Get ("pipeline_events" ).(bool )),
116
+ WikiPageEvents : gitlab .Bool (d .Get ("wiki_page_events" ).(bool )),
117
+ DeploymentEvents : gitlab .Bool (d .Get ("deployment_events" ).(bool )),
118
+ EnableSSLVerification : gitlab .Bool (d .Get ("enable_ssl_verification" ).(bool )),
96
119
}
97
120
98
121
if v , ok := d .GetOk ("token" ); ok {
@@ -127,13 +150,17 @@ func resourceGitlabProjectHookRead(d *schema.ResourceData, meta interface{}) err
127
150
128
151
d .Set ("url" , hook .URL )
129
152
d .Set ("push_events" , hook .PushEvents )
153
+ d .Set ("push_events_branch_filter" , hook .PushEventsBranchFilter )
130
154
d .Set ("issues_events" , hook .IssuesEvents )
155
+ d .Set ("confidential_issues_events" , hook .ConfidentialIssuesEvents )
131
156
d .Set ("merge_requests_events" , hook .MergeRequestsEvents )
132
157
d .Set ("tag_push_events" , hook .TagPushEvents )
133
158
d .Set ("note_events" , hook .NoteEvents )
159
+ d .Set ("confidential_note_events" , hook .ConfidentialNoteEvents )
134
160
d .Set ("job_events" , hook .JobEvents )
135
161
d .Set ("pipeline_events" , hook .PipelineEvents )
136
162
d .Set ("wiki_page_events" , hook .WikiPageEvents )
163
+ d .Set ("deployment_events" , hook .DeploymentEvents )
137
164
d .Set ("enable_ssl_verification" , hook .EnableSSLVerification )
138
165
return nil
139
166
}
@@ -146,16 +173,20 @@ func resourceGitlabProjectHookUpdate(d *schema.ResourceData, meta interface{}) e
146
173
return err
147
174
}
148
175
options := & gitlab.EditProjectHookOptions {
149
- URL : gitlab .String (d .Get ("url" ).(string )),
150
- PushEvents : gitlab .Bool (d .Get ("push_events" ).(bool )),
151
- IssuesEvents : gitlab .Bool (d .Get ("issues_events" ).(bool )),
152
- MergeRequestsEvents : gitlab .Bool (d .Get ("merge_requests_events" ).(bool )),
153
- TagPushEvents : gitlab .Bool (d .Get ("tag_push_events" ).(bool )),
154
- NoteEvents : gitlab .Bool (d .Get ("note_events" ).(bool )),
155
- JobEvents : gitlab .Bool (d .Get ("job_events" ).(bool )),
156
- PipelineEvents : gitlab .Bool (d .Get ("pipeline_events" ).(bool )),
157
- WikiPageEvents : gitlab .Bool (d .Get ("wiki_page_events" ).(bool )),
158
- EnableSSLVerification : gitlab .Bool (d .Get ("enable_ssl_verification" ).(bool )),
176
+ URL : gitlab .String (d .Get ("url" ).(string )),
177
+ PushEvents : gitlab .Bool (d .Get ("push_events" ).(bool )),
178
+ PushEventsBranchFilter : gitlab .String (d .Get ("push_events_branch_filter" ).(string )),
179
+ IssuesEvents : gitlab .Bool (d .Get ("issues_events" ).(bool )),
180
+ ConfidentialIssuesEvents : gitlab .Bool (d .Get ("confidential_issues_events" ).(bool )),
181
+ MergeRequestsEvents : gitlab .Bool (d .Get ("merge_requests_events" ).(bool )),
182
+ TagPushEvents : gitlab .Bool (d .Get ("tag_push_events" ).(bool )),
183
+ NoteEvents : gitlab .Bool (d .Get ("note_events" ).(bool )),
184
+ ConfidentialNoteEvents : gitlab .Bool (d .Get ("confidential_note_events" ).(bool )),
185
+ JobEvents : gitlab .Bool (d .Get ("job_events" ).(bool )),
186
+ PipelineEvents : gitlab .Bool (d .Get ("pipeline_events" ).(bool )),
187
+ WikiPageEvents : gitlab .Bool (d .Get ("wiki_page_events" ).(bool )),
188
+ DeploymentEvents : gitlab .Bool (d .Get ("deployment_events" ).(bool )),
189
+ EnableSSLVerification : gitlab .Bool (d .Get ("enable_ssl_verification" ).(bool )),
159
190
}
160
191
161
192
if d .HasChange ("token" ) {
0 commit comments