@@ -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 ,
@@ -83,16 +97,19 @@ func resourceGitlabProjectHookCreate(d *schema.ResourceData, meta interface{}) e
83
97
client := meta .(* gitlab.Client )
84
98
project := d .Get ("project" ).(string )
85
99
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 )),
100
+ URL : gitlab .String (d .Get ("url" ).(string )),
101
+ PushEvents : gitlab .Bool (d .Get ("push_events" ).(bool )),
102
+ PushEventsBranchFilter : gitlab .String (d .Get ("push_events_branch_filter" ).(string )),
103
+ IssuesEvents : gitlab .Bool (d .Get ("issues_events" ).(bool )),
104
+ ConfidentialIssuesEvents : gitlab .Bool (d .Get ("confidential_issues_events" ).(bool )),
105
+ MergeRequestsEvents : gitlab .Bool (d .Get ("merge_requests_events" ).(bool )),
106
+ TagPushEvents : gitlab .Bool (d .Get ("tag_push_events" ).(bool )),
107
+ NoteEvents : gitlab .Bool (d .Get ("note_events" ).(bool )),
108
+ ConfidentialNoteEvents : gitlab .Bool (d .Get ("confidential_note_events" ).(bool )),
109
+ JobEvents : gitlab .Bool (d .Get ("job_events" ).(bool )),
110
+ PipelineEvents : gitlab .Bool (d .Get ("pipeline_events" ).(bool )),
111
+ WikiPageEvents : gitlab .Bool (d .Get ("wiki_page_events" ).(bool )),
112
+ EnableSSLVerification : gitlab .Bool (d .Get ("enable_ssl_verification" ).(bool )),
96
113
}
97
114
98
115
if v , ok := d .GetOk ("token" ); ok {
@@ -127,10 +144,13 @@ func resourceGitlabProjectHookRead(d *schema.ResourceData, meta interface{}) err
127
144
128
145
d .Set ("url" , hook .URL )
129
146
d .Set ("push_events" , hook .PushEvents )
147
+ d .Set ("push_events_branch_filter" , hook .PushEventsBranchFilter )
130
148
d .Set ("issues_events" , hook .IssuesEvents )
149
+ d .Set ("confidential_issues_events" , hook .ConfidentialIssuesEvents )
131
150
d .Set ("merge_requests_events" , hook .MergeRequestsEvents )
132
151
d .Set ("tag_push_events" , hook .TagPushEvents )
133
152
d .Set ("note_events" , hook .NoteEvents )
153
+ d .Set ("confidential_note_events" , hook .ConfidentialNoteEvents )
134
154
d .Set ("job_events" , hook .JobEvents )
135
155
d .Set ("pipeline_events" , hook .PipelineEvents )
136
156
d .Set ("wiki_page_events" , hook .WikiPageEvents )
@@ -146,16 +166,19 @@ func resourceGitlabProjectHookUpdate(d *schema.ResourceData, meta interface{}) e
146
166
return err
147
167
}
148
168
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 )),
169
+ URL : gitlab .String (d .Get ("url" ).(string )),
170
+ PushEvents : gitlab .Bool (d .Get ("push_events" ).(bool )),
171
+ PushEventsBranchFilter : gitlab .String (d .Get ("push_events_branch_filter" ).(string )),
172
+ IssuesEvents : gitlab .Bool (d .Get ("issues_events" ).(bool )),
173
+ ConfidentialIssuesEvents : gitlab .Bool (d .Get ("confidential_issues_events" ).(bool )),
174
+ MergeRequestsEvents : gitlab .Bool (d .Get ("merge_requests_events" ).(bool )),
175
+ TagPushEvents : gitlab .Bool (d .Get ("tag_push_events" ).(bool )),
176
+ NoteEvents : gitlab .Bool (d .Get ("note_events" ).(bool )),
177
+ ConfidentialNoteEvents : gitlab .Bool (d .Get ("confidential_note_events" ).(bool )),
178
+ JobEvents : gitlab .Bool (d .Get ("job_events" ).(bool )),
179
+ PipelineEvents : gitlab .Bool (d .Get ("pipeline_events" ).(bool )),
180
+ WikiPageEvents : gitlab .Bool (d .Get ("wiki_page_events" ).(bool )),
181
+ EnableSSLVerification : gitlab .Bool (d .Get ("enable_ssl_verification" ).(bool )),
159
182
}
160
183
161
184
if d .HasChange ("token" ) {
0 commit comments