@@ -39,10 +39,12 @@ test.serial('Publish a release', async (t) => {
39
39
const releaseId = 1 ;
40
40
const uploadUri = `/api/uploads/repos/${ owner } /${ repo } /releases/${ releaseId } /assets` ;
41
41
const uploadUrl = `https://github.com${ uploadUri } {?name,label}` ;
42
+ const branch = 'test_branch' ;
42
43
43
44
const github = authenticate ( env )
44
45
. post ( `/repos/${ owner } /${ repo } /releases` , {
45
46
tag_name : nextRelease . gitTag ,
47
+ target_commitish : branch ,
46
48
name : nextRelease . name ,
47
49
body : nextRelease . notes ,
48
50
prerelease : false ,
@@ -53,7 +55,7 @@ test.serial('Publish a release', async (t) => {
53
55
cwd,
54
56
env,
55
57
options,
56
- branch : { type : 'release' , main : true } ,
58
+ branch : { name : branch , type : 'release' , main : true } ,
57
59
nextRelease,
58
60
logger : t . context . logger ,
59
61
} ) ;
@@ -74,10 +76,12 @@ test.serial('Publish a release on a channel', async (t) => {
74
76
const releaseId = 1 ;
75
77
const uploadUri = `/api/uploads/repos/${ owner } /${ repo } /releases/${ releaseId } /assets` ;
76
78
const uploadUrl = `https://github.com${ uploadUri } {?name,label}` ;
79
+ const branch = 'test_branch' ;
77
80
78
81
const github = authenticate ( env )
79
82
. post ( `/repos/${ owner } /${ repo } /releases` , {
80
83
tag_name : nextRelease . gitTag ,
84
+ target_commitish : branch ,
81
85
name : nextRelease . name ,
82
86
body : nextRelease . notes ,
83
87
prerelease : true ,
@@ -88,7 +92,7 @@ test.serial('Publish a release on a channel', async (t) => {
88
92
cwd,
89
93
env,
90
94
options,
91
- branch : { type : 'release' , channel : 'next' , main : false } ,
95
+ branch : { name : branch , type : 'release' , channel : 'next' , main : false } ,
92
96
nextRelease,
93
97
logger : t . context . logger ,
94
98
} ) ;
@@ -109,10 +113,12 @@ test.serial('Publish a prerelease', async (t) => {
109
113
const releaseId = 1 ;
110
114
const uploadUri = `/api/uploads/repos/${ owner } /${ repo } /releases/${ releaseId } /assets` ;
111
115
const uploadUrl = `https://github.com${ uploadUri } {?name,label}` ;
116
+ const branch = 'test_branch' ;
112
117
113
118
const github = authenticate ( env )
114
119
. post ( `/repos/${ owner } /${ repo } /releases` , {
115
120
tag_name : nextRelease . gitTag ,
121
+ target_commitish : branch ,
116
122
name : nextRelease . name ,
117
123
body : nextRelease . notes ,
118
124
prerelease : true ,
@@ -123,7 +129,7 @@ test.serial('Publish a prerelease', async (t) => {
123
129
cwd,
124
130
env,
125
131
options,
126
- branch : { type : 'prerelease' , channel : 'beta' } ,
132
+ branch : { name : branch , type : 'prerelease' , channel : 'beta' } ,
127
133
nextRelease,
128
134
logger : t . context . logger ,
129
135
} ) ;
@@ -144,10 +150,12 @@ test.serial('Publish a maintenance release', async (t) => {
144
150
const releaseId = 1 ;
145
151
const uploadUri = `/api/uploads/repos/${ owner } /${ repo } /releases/${ releaseId } /assets` ;
146
152
const uploadUrl = `https://github.com${ uploadUri } {?name,label}` ;
153
+ const branch = 'test_branch' ;
147
154
148
155
const github = authenticate ( env )
149
156
. post ( `/repos/${ owner } /${ repo } /releases` , {
150
157
tag_name : nextRelease . gitTag ,
158
+ target_commitish : branch ,
151
159
name : nextRelease . name ,
152
160
body : nextRelease . notes ,
153
161
prerelease : false ,
@@ -158,7 +166,7 @@ test.serial('Publish a maintenance release', async (t) => {
158
166
cwd,
159
167
env,
160
168
options,
161
- branch : { type : 'maintenance' , channel : '1.x' , main : false } ,
169
+ branch : { name : 'test_branch' , type : 'maintenance' , channel : '1.x' , main : false } ,
162
170
nextRelease,
163
171
logger : t . context . logger ,
164
172
} ) ;
@@ -179,10 +187,12 @@ test.serial('Publish a release, retrying 4 times', async (t) => {
179
187
const releaseId = 1 ;
180
188
const uploadUri = `/api/uploads/repos/${ owner } /${ repo } /releases/${ releaseId } /assets` ;
181
189
const uploadUrl = `https://github.com${ uploadUri } {?name,label}` ;
190
+ const branch = 'test_branch' ;
182
191
183
192
const github = authenticate ( env )
184
193
. post ( `/repos/${ owner } /${ repo } /releases` , {
185
194
tag_name : nextRelease . gitTag ,
195
+ target_commitish : branch ,
186
196
name : nextRelease . gitTag ,
187
197
body : nextRelease . notes ,
188
198
prerelease : false ,
@@ -191,6 +201,7 @@ test.serial('Publish a release, retrying 4 times', async (t) => {
191
201
. reply ( 404 )
192
202
. post ( `/repos/${ owner } /${ repo } /releases` , {
193
203
tag_name : nextRelease . gitTag ,
204
+ target_commitish : branch ,
194
205
name : nextRelease . name ,
195
206
body : nextRelease . notes ,
196
207
prerelease : false ,
@@ -201,7 +212,7 @@ test.serial('Publish a release, retrying 4 times', async (t) => {
201
212
cwd,
202
213
env,
203
214
options,
204
- branch : { type : 'release' , main : true } ,
215
+ branch : { name : branch , type : 'release' , main : true } ,
205
216
nextRelease,
206
217
logger : t . context . logger ,
207
218
} ) ;
@@ -226,10 +237,12 @@ test.serial('Publish a release with one asset', async (t) => {
226
237
const releaseId = 1 ;
227
238
const uploadUri = `/api/uploads/repos/${ owner } /${ repo } /releases/${ releaseId } /assets` ;
228
239
const uploadUrl = `https://github.com${ uploadUri } {?name,label}` ;
240
+ const branch = 'test_branch' ;
229
241
230
242
const github = authenticate ( env )
231
243
. post ( `/repos/${ owner } /${ repo } /releases` , {
232
244
tag_name : nextRelease . gitTag ,
245
+ target_commitish : branch ,
233
246
name : nextRelease . name ,
234
247
body : nextRelease . notes ,
235
248
draft : true ,
@@ -250,7 +263,7 @@ test.serial('Publish a release with one asset', async (t) => {
250
263
cwd,
251
264
env,
252
265
options,
253
- branch : { type : 'release' , main : true } ,
266
+ branch : { name : branch , type : 'release' , main : true } ,
254
267
nextRelease,
255
268
logger : t . context . logger ,
256
269
} ) ;
@@ -277,10 +290,12 @@ test.serial('Publish a release with one asset and custom github url', async (t)
277
290
const releaseId = 1 ;
278
291
const uploadUri = `/api/uploads/repos/${ owner } /${ repo } /releases/${ releaseId } /assets` ;
279
292
const uploadUrl = `${ env . GH_URL } ${ uploadUri } {?name,label}` ;
293
+ const branch = 'test_branch' ;
280
294
281
295
const github = authenticate ( env , { } )
282
296
. post ( `/repos/${ owner } /${ repo } /releases` , {
283
297
tag_name : nextRelease . gitTag ,
298
+ target_commitish : branch ,
284
299
name : nextRelease . name ,
285
300
body : nextRelease . notes ,
286
301
draft : true ,
@@ -301,7 +316,7 @@ test.serial('Publish a release with one asset and custom github url', async (t)
301
316
cwd,
302
317
env,
303
318
options,
304
- branch : { type : 'release' , main : true } ,
319
+ branch : { name : branch , type : 'release' , main : true } ,
305
320
nextRelease,
306
321
logger : t . context . logger ,
307
322
} ) ;
@@ -326,10 +341,12 @@ test.serial('Publish a release with an array of missing assets', async (t) => {
326
341
const releaseId = 1 ;
327
342
const uploadUri = `/api/uploads/repos/${ owner } /${ repo } /releases/${ releaseId } /assets` ;
328
343
const uploadUrl = `https://github.com${ uploadUri } {?name,label}` ;
344
+ const branch = 'test_branch' ;
329
345
330
346
const github = authenticate ( env )
331
347
. post ( `/repos/${ owner } /${ repo } /releases` , {
332
348
tag_name : nextRelease . gitTag ,
349
+ target_commitish : branch ,
333
350
name : nextRelease . name ,
334
351
body : nextRelease . notes ,
335
352
draft : true ,
@@ -343,7 +360,7 @@ test.serial('Publish a release with an array of missing assets', async (t) => {
343
360
cwd,
344
361
env,
345
362
options,
346
- branch : { type : 'release' , main : true } ,
363
+ branch : { name : branch , type : 'release' , main : true } ,
347
364
nextRelease,
348
365
logger : t . context . logger ,
349
366
} ) ;
@@ -362,17 +379,20 @@ test.serial('Throw error without retries for 400 error', async (t) => {
362
379
const pluginConfig = { } ;
363
380
const nextRelease = { gitTag : 'v1.0.0' , name : 'v1.0.0' , notes : 'Test release note body' } ;
364
381
const options = { repositoryUrl : `https://github.com/${ owner } /${ repo } .git` } ;
382
+ const branch = 'test_branch' ;
365
383
366
384
const github = authenticate ( env )
367
385
. post ( `/repos/${ owner } /${ repo } /releases` , {
368
386
tag_name : nextRelease . gitTag ,
387
+ target_commitish : branch ,
369
388
name : nextRelease . name ,
370
389
body : nextRelease . notes ,
371
390
prerelease : false ,
372
391
} )
373
392
. reply ( 404 )
374
393
. post ( `/repos/${ owner } /${ repo } /releases` , {
375
394
tag_name : nextRelease . gitTag ,
395
+ target_commitish : branch ,
376
396
name : nextRelease . gitTag ,
377
397
body : nextRelease . notes ,
378
398
prerelease : false ,
@@ -384,7 +404,7 @@ test.serial('Throw error without retries for 400 error', async (t) => {
384
404
cwd,
385
405
env,
386
406
options,
387
- branch : { type : 'release' , main : true } ,
407
+ branch : { name : branch , type : 'release' , main : true } ,
388
408
nextRelease,
389
409
logger : t . context . logger ,
390
410
} )
@@ -411,10 +431,12 @@ test.serial(
411
431
const releaseId = 1 ;
412
432
const uploadUri = `/api/uploads/repos/${ owner } /${ repo } /releases/${ releaseId } /assets` ;
413
433
const uploadUrl = `https://github.com${ uploadUri } {?name,label}` ;
434
+ const branch = 'test_branch' ;
414
435
415
436
const github = authenticate ( env )
416
437
. post ( `/repos/${ owner } /${ repo } /releases` , {
417
438
tag_name : nextRelease . gitTag ,
439
+ target_commitish : branch ,
418
440
name : nextRelease . name ,
419
441
body : nextRelease . notes ,
420
442
prerelease : false ,
@@ -425,7 +447,7 @@ test.serial(
425
447
cwd,
426
448
env,
427
449
options,
428
- branch : { type : 'release' , main : true } ,
450
+ branch : { name : branch , type : 'release' , main : true } ,
429
451
nextRelease,
430
452
logger : t . context . logger ,
431
453
} ) ;
0 commit comments