@@ -84,8 +84,7 @@ func (s *RepositoriesService) ListDeployments(owner, repo string, opt *Deploymen
8484
8585// GetDeployment returns a single deployment of a repository.
8686//
87- // GitHub API docs: https://developer.github.com/v3/repos/deployments/
88- // Note: GetDeployment uses the undocumented GitHub API endpoint /repos/:owner/:repo/deployments/:id.
87+ // GitHub API docs: https://developer.github.com/v3/repos/deployments/#get-a-single-deployment
8988func (s * RepositoriesService ) GetDeployment (owner , repo string , deploymentID int ) (* Deployment , * Response , error ) {
9089 u := fmt .Sprintf ("repos/%v/%v/deployments/%v" , owner , repo , deploymentID )
9190
@@ -176,6 +175,29 @@ func (s *RepositoriesService) ListDeploymentStatuses(owner, repo string, deploym
176175 return * statuses , resp , err
177176}
178177
178+ // GetDeploymentStatus returns a single deployment status of a repository.
179+ //
180+ // GitHub API docs: https://developer.github.com/v3/repos/deployments/#get-a-single-deployment-status
181+ func (s * RepositoriesService ) GetDeploymentStatus (owner , repo string , deploymentID , deploymentStatusID int ) (* DeploymentStatus , * Response , error ) {
182+ u := fmt .Sprintf ("repos/%v/%v/deployments/%v/statuses/%v" , owner , repo , deploymentID , deploymentStatusID )
183+
184+ req , err := s .client .NewRequest ("GET" , u , nil )
185+ if err != nil {
186+ return nil , nil , err
187+ }
188+
189+ // TODO: remove custom Accept header when deployment support fully launches
190+ req .Header .Set ("Accept" , mediaTypeDeploymentStatusPreview )
191+
192+ d := new (DeploymentStatus )
193+ resp , err := s .client .Do (req , d )
194+ if err != nil {
195+ return nil , resp , err
196+ }
197+
198+ return d , resp , err
199+ }
200+
179201// CreateDeploymentStatus creates a new status for a deployment.
180202//
181203// GitHub API docs: https://developer.github.com/v3/repos/deployments/#create-a-deployment-status
0 commit comments