File tree Expand file tree Collapse file tree 2 files changed +6
-7
lines changed Expand file tree Collapse file tree 2 files changed +6
-7
lines changed Original file line number Diff line number Diff line change @@ -422,12 +422,10 @@ class GithubScm extends Scm {
422
422
scmUri : config . scmUri ,
423
423
token : config . token
424
424
} ) . then ( ( scmInfo ) => {
425
- let context = `Screwdriver/${ config . pipelineId } /` ;
426
-
427
- context += / ^ P R / . test ( config . jobName ) ? 'PR' : config . jobName ;
425
+ const jobName = config . jobName . replace ( / ^ P R - \d + / g, 'PR' ) ;
428
426
429
427
const params = {
430
- context,
428
+ context : `Screwdriver/ ${ config . pipelineId } / ${ jobName } ` ,
431
429
description : DESCRIPTION_MAP [ config . buildStatus ] ,
432
430
repo : scmInfo . repo ,
433
431
sha : config . sha ,
Original file line number Diff line number Diff line change @@ -461,7 +461,7 @@ describe('index', function () {
461
461
) ;
462
462
463
463
it ( 'sets context for PR when jobName passed in' , ( ) => {
464
- config . jobName = 'PR-15' ;
464
+ config . jobName = 'PR-15:test ' ;
465
465
466
466
return scm . updateCommitStatus ( config )
467
467
. then ( ( result ) => {
@@ -473,7 +473,7 @@ describe('index', function () {
473
473
sha : config . sha ,
474
474
state : 'success' ,
475
475
description : 'Everything looks good!' ,
476
- context : 'Screwdriver/675/PR' ,
476
+ context : 'Screwdriver/675/PR:test ' ,
477
477
target_url : 'https://foo.bar'
478
478
} ) ;
479
479
assert . calledWith ( githubMock . authenticate , {
@@ -560,7 +560,8 @@ describe('index', function () {
560
560
sha : 'ccc49349d3cffbd12ea9e3d41521480b4aa5de5f' ,
561
561
buildStatus : 'SUCCESS' ,
562
562
token : 'somerandomtoken' ,
563
- url : 'https://foo.bar'
563
+ url : 'https://foo.bar' ,
564
+ jobName : 'main'
564
565
} ;
565
566
566
567
githubMock . repos . getById . yieldsAsync ( null , {
You can’t perform that action at this time.
0 commit comments