99 "context"
1010 "encoding/json"
1111 "fmt"
12+ "strings"
1213)
1314
1415// Deployment represents a deployment in a repo
@@ -116,7 +117,8 @@ func (s *RepositoriesService) CreateDeployment(ctx context.Context, owner, repo
116117 }
117118
118119 // TODO: remove custom Accept headers when APIs fully launch.
119- req .Header .Set ("Accept" , mediaTypeDeploymentStatusPreview )
120+ acceptHeaders := []string {mediaTypeDeploymentStatusPreview , mediaTypeExpandDeploymentStatusPreview }
121+ req .Header .Set ("Accept" , strings .Join (acceptHeaders , ", " ))
120122
121123 d := new (Deployment )
122124 resp , err := s .client .Do (ctx , req , d )
@@ -149,6 +151,7 @@ type DeploymentStatusRequest struct {
149151 State * string `json:"state,omitempty"`
150152 LogURL * string `json:"log_url,omitempty"`
151153 Description * string `json:"description,omitempty"`
154+ Environment * string `json:"environment,omitempty"`
152155 EnvironmentURL * string `json:"environment_url,omitempty"`
153156 AutoInactive * bool `json:"auto_inactive,omitempty"`
154157}
@@ -189,7 +192,8 @@ func (s *RepositoriesService) GetDeploymentStatus(ctx context.Context, owner, re
189192 }
190193
191194 // TODO: remove custom Accept headers when APIs fully launch.
192- req .Header .Set ("Accept" , mediaTypeDeploymentStatusPreview )
195+ acceptHeaders := []string {mediaTypeDeploymentStatusPreview , mediaTypeExpandDeploymentStatusPreview }
196+ req .Header .Set ("Accept" , strings .Join (acceptHeaders , ", " ))
193197
194198 d := new (DeploymentStatus )
195199 resp , err := s .client .Do (ctx , req , d )
@@ -212,7 +216,8 @@ func (s *RepositoriesService) CreateDeploymentStatus(ctx context.Context, owner,
212216 }
213217
214218 // TODO: remove custom Accept headers when APIs fully launch.
215- req .Header .Set ("Accept" , mediaTypeDeploymentStatusPreview )
219+ acceptHeaders := []string {mediaTypeDeploymentStatusPreview , mediaTypeExpandDeploymentStatusPreview }
220+ req .Header .Set ("Accept" , strings .Join (acceptHeaders , ", " ))
216221
217222 d := new (DeploymentStatus )
218223 resp , err := s .client .Do (ctx , req , d )
0 commit comments