@@ -118,7 +118,7 @@ class Repository {
118
118
} ) ;
119
119
}
120
120
121
- async updateFile ( { filePath, content, branchName, originalSha, convention } ) {
121
+ async updateFile ( { filePath, content, branchName, originalSha, convention, commitType } ) {
122
122
const contentBinary = Buffer . from ( content ) . toString ( "base64" ) ;
123
123
124
124
//octokit.github.io/rest.js/#api-Repos-updateFile
@@ -127,7 +127,7 @@ class Repository {
127
127
repo : this . repo ,
128
128
path : filePath ,
129
129
message : convertMessage ( {
130
- tag : "docs" ,
130
+ tag : commitType ,
131
131
msg : `update ${ filePath } ${ this . skipCiString } ` ,
132
132
convention,
133
133
} ) . trim ( ) ,
@@ -137,7 +137,7 @@ class Repository {
137
137
} ) ;
138
138
}
139
139
140
- async createFile ( { filePath, content, branchName, convention } ) {
140
+ async createFile ( { filePath, content, branchName, convention, commitType } ) {
141
141
const contentBinary = Buffer . from ( content ) . toString ( "base64" ) ;
142
142
143
143
//octokit.github.io/rest.js/#api-Repos-createFile
@@ -146,7 +146,7 @@ class Repository {
146
146
repo : this . repo ,
147
147
path : filePath ,
148
148
message : convertMessage ( {
149
- tag : "docs" ,
149
+ tag : commitType ,
150
150
msg : `create ${ filePath } ${ this . skipCiString } ` ,
151
151
convention,
152
152
} ) . trim ( ) ,
@@ -161,21 +161,23 @@ class Repository {
161
161
branchName,
162
162
originalSha,
163
163
convention,
164
+ commitType,
164
165
} ) {
165
166
if ( originalSha === undefined ) {
166
- await this . createFile ( { filePath, content, branchName, convention } ) ;
167
+ await this . createFile ( { filePath, content, branchName, convention, commitType } ) ;
167
168
} else {
168
169
await this . updateFile ( {
169
170
filePath,
170
171
content,
171
172
branchName,
172
173
originalSha,
173
174
convention,
175
+ commitType,
174
176
} ) ;
175
177
}
176
178
}
177
179
178
- async createOrUpdateFiles ( { filesByPath, branchName, convention } ) {
180
+ async createOrUpdateFiles ( { filesByPath, branchName, convention, commitType } ) {
179
181
const repository = this ;
180
182
const createOrUpdateFilesMultiple = Object . entries ( filesByPath ) . map (
181
183
( [ filePath , { content, originalSha } ] ) => {
@@ -185,6 +187,7 @@ class Repository {
185
187
branchName,
186
188
originalSha,
187
189
convention,
190
+ commitType,
188
191
} ) ;
189
192
}
190
193
) ;
@@ -252,6 +255,7 @@ class Repository {
252
255
filesByPath,
253
256
branchName,
254
257
convention,
258
+ commitType,
255
259
} ) {
256
260
const branchNameExists = branchName === this . baseBranch ;
257
261
if ( ! branchNameExists ) {
@@ -262,6 +266,7 @@ class Repository {
262
266
filesByPath,
263
267
branchName,
264
268
convention,
269
+ commitType,
265
270
} ) ;
266
271
267
272
return this . createPullRequest ( {
0 commit comments