1
- module . exports = function ( octokit , opts ) {
1
+ module . exports = function ( octokit , opts ) {
2
2
return new Promise ( async ( resolve , reject ) => {
3
3
// Up front validation
4
4
try {
@@ -19,7 +19,7 @@ module.exports = function (octokit, opts) {
19
19
base,
20
20
branch : branchName ,
21
21
createBranch,
22
- changes,
22
+ changes
23
23
} = opts ;
24
24
25
25
let branchAlreadyExists = true ;
@@ -43,7 +43,7 @@ module.exports = function (octokit, opts) {
43
43
base = (
44
44
await octokit . repos . get ( {
45
45
owner,
46
- repo,
46
+ repo
47
47
} )
48
48
) . data . default_branch ;
49
49
}
@@ -100,7 +100,7 @@ module.exports = function (octokit, opts) {
100
100
path : fileName ,
101
101
sha : null , // sha as null implies that the file should be deleted
102
102
mode : "100644" ,
103
- type : "commit" ,
103
+ type : "commit"
104
104
} ) ;
105
105
}
106
106
}
@@ -129,7 +129,7 @@ module.exports = function (octokit, opts) {
129
129
path : fileName ,
130
130
sha : fileSha ,
131
131
mode : mode ,
132
- type : type ,
132
+ type : type
133
133
} ) ;
134
134
}
135
135
@@ -176,7 +176,7 @@ module.exports = function (octokit, opts) {
176
176
repo,
177
177
force : true ,
178
178
ref : `${ updateRefBase } heads/${ branchName } ` ,
179
- sha : baseTree ,
179
+ sha : baseTree
180
180
} ) ;
181
181
182
182
// Return the new branch name so that we can use it later
@@ -195,7 +195,7 @@ async function fileExistsInRepo(octokit, owner, repo, path, branch) {
195
195
owner,
196
196
repo,
197
197
path,
198
- ref : branch ,
198
+ ref : branch
199
199
} ) ;
200
200
return true ;
201
201
} catch ( e ) {
@@ -210,7 +210,7 @@ async function createCommit(octokit, owner, repo, message, tree, baseTree) {
210
210
repo,
211
211
message,
212
212
tree : tree . sha ,
213
- parents : [ baseTree ] ,
213
+ parents : [ baseTree ]
214
214
} )
215
215
) . data ;
216
216
}
@@ -221,7 +221,7 @@ async function createTree(octokit, owner, repo, treeItems, baseTree) {
221
221
owner,
222
222
repo,
223
223
tree : treeItems ,
224
- base_tree : baseTree ,
224
+ base_tree : baseTree
225
225
} )
226
226
) . data ;
227
227
}
@@ -235,7 +235,7 @@ async function createBlob(octokit, owner, repo, contents, type) {
235
235
owner,
236
236
repo,
237
237
content : Buffer . from ( contents ) . toString ( "base64" ) ,
238
- encoding : "base64" ,
238
+ encoding : "base64"
239
239
} )
240
240
) . data ;
241
241
return file . sha ;
@@ -247,7 +247,7 @@ async function loadRef(octokit, owner, repo, ref) {
247
247
const x = await octokit . git . getRef ( {
248
248
owner,
249
249
repo,
250
- ref : `heads/${ ref } ` ,
250
+ ref : `heads/${ ref } `
251
251
} ) ;
252
252
return x . data . object . sha ;
253
253
} catch ( e ) {
0 commit comments