Skip to content

Commit 1c4160b

Browse files
committed
fix(platform-server): change repository url
fix(platform-server): change repository url change status endpoint to use the configured repository.api_url fix #350
1 parent c0f4429 commit 1c4160b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/api/commit-status.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ export function sendPendingStatus(buildData: any, buildId: number): Promise<void
5757
let sha = buildData.data.after || buildData.data.pull_request &&
5858
buildData.data.pull_request.head.sha || buildData.data.sha;
5959
let name = buildData.repository.full_name;
60-
let gitUrl = `https://api.github.com/repos/${name}/statuses/${sha}`;
60+
let gitUrl = `https://${buildData.repository.api_url || 'api.github.com'}/repos/${name}/statuses/${sha}`;
6161
let abstruseUrl = `${config.url}/build/${buildId}`;
6262

6363
return setGitHubStatusPending(gitUrl, abstruseUrl, buildData.repository.access_token);
@@ -101,7 +101,7 @@ export function sendFailureStatus(buildData: any, buildId: number): Promise<void
101101
let sha = buildData.data.after || buildData.data.pull_request &&
102102
buildData.data.pull_request.head.sha || buildData.data.sha;
103103
let name = buildData.repository.full_name;
104-
let gitUrl = `https://api.github.com/repos/${name}/statuses/${sha}`;
104+
let gitUrl = `https://${buildData.repository.api_url || 'api.github.com'}/repos/${name}/statuses/${sha}`;
105105
let abstruseUrl = `${config.url}/build/${buildId}`;
106106

107107
return setGitHubStatusFailure(gitUrl, abstruseUrl, buildData.repository.access_token);

0 commit comments

Comments
 (0)