@@ -34,7 +34,12 @@ export function sendSuccessStatus(build: any, buildId: number): Promise<void> {
3434 let id = build . data . project_id ?
3535 build . data . project_id : build . data . object_attributes . target_project_id ;
3636 let sha = build . data . checkout_sha || build . data . object_attributes . last_commit . id ;
37- let gitUrl = `https://gitlab.com/api/v4/projects/${ id } /statuses/${ sha } ` ;
37+ let gitUrl = null ;
38+ if ( build . repository . api_url && build . repository . api_url !== '' ) {
39+ gitUrl = `${ build . repository . api_url } /projects/${ id } /statuses/${ sha } ` ;
40+ } else {
41+ gitUrl = `https://gitlab.com/api/v4/projects/${ id } /statuses/${ sha } ` ;
42+ }
3843 let abstruseUrl = `${ config . url } /build/${ buildId } ` ;
3944
4045 return setGitLabStatusSuccess ( gitUrl , abstruseUrl ,
@@ -84,7 +89,12 @@ export function sendPendingStatus(buildData: any, buildId: number): Promise<void
8489 let id = buildData . data . project_id ?
8590 buildData . data . project_id : buildData . data . object_attributes . target_project_id ;
8691 let sha = buildData . data . checkout_sha || buildData . data . object_attributes . last_commit . id ;
87- let gitUrl = `https://gitlab.com/api/v4/projects/${ id } /statuses/${ sha } ` ;
92+ let gitUrl = null ;
93+ if ( buildData . repository . api_url && buildData . repository . api_url !== '' ) {
94+ gitUrl = `${ buildData . repository . api_url } /projects/${ id } /statuses/${ sha } ` ;
95+ } else {
96+ gitUrl = `https://gitlab.com/api/v4/projects/${ id } /statuses/${ sha } ` ;
97+ }
8898 let abstruseUrl = `${ config . url } /build/${ buildId } ` ;
8999
90100 return setGitLabStatusPending ( gitUrl , abstruseUrl , buildData . repository . access_token ) ;
@@ -133,7 +143,12 @@ export function sendFailureStatus(buildData: any, buildId: number): Promise<void
133143 let id = buildData . data . project_id ?
134144 buildData . data . project_id : buildData . data . object_attributes . target_project_id ;
135145 let sha = buildData . data . checkout_sha || buildData . data . object_attributes . last_commit . id ;
136- let gitUrl = `https://gitlab.com/api/v4/projects/${ id } /statuses/${ sha } ` ;
146+ let gitUrl = null ;
147+ if ( buildData . repository . api_url && buildData . repository . api_url !== '' ) {
148+ gitUrl = `${ buildData . repository . api_url } /projects/${ id } /statuses/${ sha } ` ;
149+ } else {
150+ gitUrl = `https://gitlab.com/api/v4/projects/${ id } /statuses/${ sha } ` ;
151+ }
137152 let abstruseUrl = `${ config . url } /build/${ buildId } ` ;
138153
139154 return setGitLabStatusFailure ( gitUrl , abstruseUrl , buildData . repository . access_token ) ;
0 commit comments