diff --git a/readthedocs/oauth/services/github.py b/readthedocs/oauth/services/github.py index d7701c54293..833c51573a5 100644 --- a/readthedocs/oauth/services/github.py +++ b/readthedocs/oauth/services/github.py @@ -13,6 +13,7 @@ from readthedocs.api.v2.client import api from readthedocs.builds import utils as build_utils from readthedocs.builds.constants import ( + BUILD_STATUS_SUCCESS, SELECT_BUILD_STATUS, RTD_BUILD_STATUS_API_NAME ) @@ -335,9 +336,14 @@ def send_build_status(self, build, state): github_build_state = SELECT_BUILD_STATUS[state]['github'] description = SELECT_BUILD_STATUS[state]['description'] + target_url = build.get_full_url() + + if state == BUILD_STATUS_SUCCESS: + target_url = build.version.get_absolute_url() + data = { 'state': github_build_state, - 'target_url': build.get_full_url(), + 'target_url': target_url, 'description': description, 'context': RTD_BUILD_STATUS_API_NAME }