Skip to content

Commit f8fac48

Browse files
authored
Merge pull request #5987 from saadmk11/update-build-status-url
Update GitHub build status details URL
2 parents 459eb52 + f663e91 commit f8fac48

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

readthedocs/oauth/services/github.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
from readthedocs.api.v2.client import api
1414
from readthedocs.builds import utils as build_utils
1515
from readthedocs.builds.constants import (
16+
BUILD_STATUS_SUCCESS,
1617
SELECT_BUILD_STATUS,
1718
RTD_BUILD_STATUS_API_NAME
1819
)
@@ -336,9 +337,14 @@ def send_build_status(self, build, commit, state):
336337
github_build_state = SELECT_BUILD_STATUS[state]['github']
337338
description = SELECT_BUILD_STATUS[state]['description']
338339

340+
target_url = build.get_full_url()
341+
342+
if state == BUILD_STATUS_SUCCESS:
343+
target_url = build.version.get_absolute_url()
344+
339345
data = {
340346
'state': github_build_state,
341-
'target_url': build.get_full_url(),
347+
'target_url': target_url,
342348
'description': description,
343349
'context': RTD_BUILD_STATUS_API_NAME
344350
}

0 commit comments

Comments
 (0)