@@ -55,6 +55,10 @@ func (s *contentService) Create(ctx context.Context, repo, path string, params *
55
55
Title : params .Message ,
56
56
Actions : []action {a },
57
57
BypassRules : true ,
58
+ Author : identity {
59
+ Name : params .Signature .Name ,
60
+ Email : params .Signature .Email ,
61
+ },
58
62
}
59
63
60
64
res , err := s .client .do (ctx , "POST" , endpoint , in , nil )
@@ -81,6 +85,10 @@ func (s *contentService) Update(ctx context.Context, repo, path string, params *
81
85
Title : params .Message ,
82
86
Actions : []action {a },
83
87
BypassRules : true ,
88
+ Author : identity {
89
+ Name : params .Signature .Name ,
90
+ Email : params .Signature .Email ,
91
+ },
84
92
}
85
93
86
94
res , err := s .client .do (ctx , "POST" , endpoint , in , nil )
@@ -105,6 +113,10 @@ func (s *contentService) Delete(ctx context.Context, repo, path string, params *
105
113
Title : params .Message ,
106
114
Actions : []action {a },
107
115
BypassRules : true ,
116
+ Author : identity {
117
+ Name : params .Signature .Name ,
118
+ Email : params .Signature .Email ,
119
+ },
108
120
}
109
121
110
122
res , err := s .client .do (ctx , "POST" , endpoint , in , nil )
@@ -123,109 +135,99 @@ func (s *contentService) List(ctx context.Context, repo, path, ref string, _ scm
123
135
return convertContentInfoList (out .Content .Entries ), res , err
124
136
}
125
137
126
- type editFile struct {
127
- Actions []action `json:"actions"`
128
- Branch string `json:"branch"`
129
- Message string `json:"message"`
130
- NewBranch string `json:"new_branch"`
131
- Title string `json:"title"`
138
+ type (
139
+ identity struct {
140
+ Name string `json:"name"`
141
+ Email string `json:"email"`
142
+ }
132
143
133
- BypassRules bool `json:"bypass_rules"`
134
- }
144
+ editFile struct {
145
+ Actions []action `json:"actions"`
146
+ Author identity `json:"author"`
147
+ Branch string `json:"branch"`
148
+ Message string `json:"message"`
149
+ NewBranch string `json:"new_branch"`
150
+ Title string `json:"title"`
135
151
136
- type action struct {
137
- Action string `json:"action"`
138
- Encoding string `json:"encoding"`
139
- Path string `json:"path"`
140
- Payload string `json:"payload"`
141
- Sha string `json:"sha"`
142
- }
152
+ BypassRules bool `json:"bypass_rules"`
153
+ }
143
154
144
- type fileContent struct {
145
- Type string `json:"type"`
146
- Sha string `json:"sha"`
147
- Name string `json:"name"`
148
- Path string `json:"path"`
149
- LatestCommit struct {
150
- Sha string `json:"sha"`
151
- Title string `json:"title"`
152
- Message string `json:"message"`
153
- Author struct {
154
- Identity struct {
155
- Name string `json:"name"`
156
- Email string `json:"email"`
157
- } `json:"identity"`
158
- When time.Time `json:"when"`
159
- } `json:"author"`
160
- Committer struct {
161
- Identity struct {
162
- Name string `json:"name"`
163
- Email string `json:"email"`
164
- } `json:"identity"`
165
- When time.Time `json:"when"`
166
- } `json:"committer"`
167
- } `json:"latest_commit"`
168
- Content struct {
155
+ action struct {
156
+ Action string `json:"action"`
169
157
Encoding string `json:"encoding"`
170
- Data string `json:"data "`
171
- Size int `json:"size "`
172
- } `json:"content "`
173
- }
158
+ Path string `json:"path "`
159
+ Payload string `json:"payload "`
160
+ Sha string `json:"sha "`
161
+ }
174
162
175
- type contentList struct {
176
- Type string `json:"type"`
177
- Sha string `json:"sha"`
178
- Name string `json:"name"`
179
- Path string `json:"path"`
180
- LatestCommit struct {
181
- Sha string `json:"sha"`
182
- Title string `json:"title"`
183
- Message string `json:"message"`
184
- Author struct {
185
- Identity struct {
186
- Name string `json:"name"`
187
- Email string `json:"email"`
188
- } `json:"identity"`
189
- When time.Time `json:"when"`
190
- } `json:"author"`
191
- Committer struct {
192
- Identity struct {
193
- Name string `json:"name"`
194
- Email string `json:"email"`
195
- } `json:"identity"`
196
- When time.Time `json:"when"`
197
- } `json:"committer"`
198
- } `json:"latest_commit"`
199
- Content struct {
200
- Entries []fileEntry `json:"entries"`
201
- } `json:"content"`
202
- }
163
+ fileContent struct {
164
+ Type string `json:"type"`
165
+ Sha string `json:"sha"`
166
+ Name string `json:"name"`
167
+ Path string `json:"path"`
168
+ LatestCommit struct {
169
+ Sha string `json:"sha"`
170
+ Title string `json:"title"`
171
+ Message string `json:"message"`
172
+ Author struct {
173
+ Identity identity `json:"identity"`
174
+ When time.Time `json:"when"`
175
+ } `json:"author"`
176
+ Committer struct {
177
+ Identity identity `json:"identity"`
178
+ When time.Time `json:"when"`
179
+ } `json:"committer"`
180
+ } `json:"latest_commit"`
181
+ Content struct {
182
+ Encoding string `json:"encoding"`
183
+ Data string `json:"data"`
184
+ Size int `json:"size"`
185
+ } `json:"content"`
186
+ }
203
187
204
- type fileEntry struct {
205
- Type string `json:"type"`
206
- Sha string `json:"sha"`
207
- Name string `json:"name"`
208
- Path string `json:"path"`
209
- LatestCommit struct {
210
- Sha string `json:"sha"`
211
- Title string `json:"title"`
212
- Message string `json:"message"`
213
- Author struct {
214
- Identity struct {
215
- Name string `json:"name"`
216
- Email string `json:"email"`
217
- } `json:"identity"`
218
- When time.Time `json:"when"`
219
- } `json:"author"`
220
- Committer struct {
221
- Identity struct {
222
- Name string `json:"name"`
223
- Email string `json:"email"`
224
- } `json:"identity"`
225
- When time.Time `json:"when"`
226
- } `json:"committer"`
227
- } `json:"latest_commit"`
228
- }
188
+ contentList struct {
189
+ Type string `json:"type"`
190
+ Sha string `json:"sha"`
191
+ Name string `json:"name"`
192
+ Path string `json:"path"`
193
+ LatestCommit struct {
194
+ Sha string `json:"sha"`
195
+ Title string `json:"title"`
196
+ Message string `json:"message"`
197
+ Author struct {
198
+ Identity identity `json:"identity"`
199
+ When time.Time `json:"when"`
200
+ } `json:"author"`
201
+ Committer struct {
202
+ Identity identity `json:"identity"`
203
+ When time.Time `json:"when"`
204
+ } `json:"committer"`
205
+ } `json:"latest_commit"`
206
+ Content struct {
207
+ Entries []fileEntry `json:"entries"`
208
+ } `json:"content"`
209
+ }
210
+
211
+ fileEntry struct {
212
+ Type string `json:"type"`
213
+ Sha string `json:"sha"`
214
+ Name string `json:"name"`
215
+ Path string `json:"path"`
216
+ LatestCommit struct {
217
+ Sha string `json:"sha"`
218
+ Title string `json:"title"`
219
+ Message string `json:"message"`
220
+ Author struct {
221
+ Identity identity `json:"identity"`
222
+ When time.Time `json:"when"`
223
+ } `json:"author"`
224
+ Committer struct {
225
+ Identity identity `json:"identity"`
226
+ When time.Time `json:"when"`
227
+ } `json:"committer"`
228
+ } `json:"latest_commit"`
229
+ }
230
+ )
229
231
230
232
func convertContentInfoList (from []fileEntry ) []* scm.ContentInfo {
231
233
to := []* scm.ContentInfo {}
0 commit comments