fix github build status bug
@@ -13,6 +13,7 @@ from requests.exceptions import RequestException
from readthedocs.api.v2.client import api
from readthedocs.builds import utils as build_utils
from readthedocs.builds.constants import (
+ BUILD_STATUS_PENDING,
SELECT_BUILD_STATUS,
RTD_BUILD_STATUS_API_NAME
)
@@ -329,7 +330,11 @@ class GitHubService(Service):
session = self.get_session()
project = build.project
owner, repo = build_utils.get_github_username_repo(url=project.repo)
+
+ if state == BUILD_STATUS_PENDING:
build_sha = build.version.identifier
+ else:
+ build_sha = build.commit
# select the correct state and description.
github_build_state = SELECT_BUILD_STATUS[state]['github']
