Skip to content

Commit

Permalink
capture deployment url for deploy hooks
Browse files Browse the repository at this point in the history
  • Loading branch information
bradrydzewski committed Aug 26, 2019
1 parent d944d81 commit cee7788
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions scm/driver/github/testdata/webhooks/deployment.json.golden
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
"Created": "0001-01-01T00:00:00Z",
"Updated": "0001-01-01T00:00:00Z"
},
"Link": "https://api.github.com/repos/Codertocat/Hello-World/deployments/87972451",
"Target": "production",
"TargetURL": "",
"Task": "deploy"
Expand Down
2 changes: 2 additions & 0 deletions scm/driver/github/webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,7 @@ type (
Description null.String `json:"description"`
Environment null.String `json:"environment"`
EnvironmentURL null.String `json:"environment_url"`
URL null.String `json:"url"`
Sha null.String `json:"sha"`
Ref null.String `json:"ref"`
Task null.String `json:"task"`
Expand Down Expand Up @@ -358,6 +359,7 @@ func convertPullRequestHook(src *pullRequestHook) *scm.PullRequestHook {

func convertDeploymentHook(src *deploymentHook) *scm.DeployHook {
dst := &scm.DeployHook{
Link: src.Deployment.URL.String,
Data: src.Deployment.Payload,
Desc: src.Deployment.Description.String,
Ref: scm.Reference{
Expand Down
1 change: 1 addition & 0 deletions scm/webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ type (
Target string
TargetURL string
Task string
Link string
}

// SecretFunc provides the Webhook parser with the
Expand Down

0 comments on commit cee7788

Please sign in to comment.