Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions out_command.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ func (c *OutCommand) Run(sourceDir string, request OutRequest) (OutResponse, err
Description: github.String(request.Params.Description),
}

if request.Params.Target != "" {
newStatus.EnvironmentURL = github.String(request.Params.Target)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems to conflate target and environment? Should the Params field also be EnvironmentURL?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure, i was originally doing this for TargetUrl and then they did the old api update on me

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@eliotstocker Ping. :)

}

fmt.Fprintln(c.writer, "creating deployment status")
_, err = c.github.CreateDeploymentStatus(*deployment.ID, newStatus)
if err != nil {
Expand Down
6 changes: 6 additions & 0 deletions resources.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ type OutResponse struct {
type OutParams struct {
Type string `json:"type"`
ID string
Target string
Ref string
Environment string
Task string
Expand All @@ -60,6 +61,7 @@ type OutParams struct {
PayloadPath string `json:"payload_path"`

RawID json.RawMessage `json:"id"`
RawTarget json.RawMessage `json:"target"`
RawState json.RawMessage `json:"state"`
RawRef json.RawMessage `json:"ref"`
RawTask json.RawMessage `json:"task"`
Expand Down Expand Up @@ -102,6 +104,10 @@ func (p *OutParams) UnmarshalJSON(b []byte) (err error) {
p.Description = getStringOrStringFromFile(p.RawDescription)
}

if p.RawTarget != nil {
p.Target = getStringOrStringFromFile(p.RawTarget)
}

var payload map[string]interface{}
json.Unmarshal(p.RawPayload, &payload)

Expand Down