Skip to content

Commit cee7788

Browse files
committed
capture deployment url for deploy hooks
1 parent d944d81 commit cee7788

File tree

3 files changed

+4
-0
lines changed

3 files changed

+4
-0
lines changed

scm/driver/github/testdata/webhooks/deployment.json.golden

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
"Created": "0001-01-01T00:00:00Z",
3030
"Updated": "0001-01-01T00:00:00Z"
3131
},
32+
"Link": "https://api.github.com/repos/Codertocat/Hello-World/deployments/87972451",
3233
"Target": "production",
3334
"TargetURL": "",
3435
"Task": "deploy"

scm/driver/github/webhook.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,7 @@ type (
243243
Description null.String `json:"description"`
244244
Environment null.String `json:"environment"`
245245
EnvironmentURL null.String `json:"environment_url"`
246+
URL null.String `json:"url"`
246247
Sha null.String `json:"sha"`
247248
Ref null.String `json:"ref"`
248249
Task null.String `json:"task"`
@@ -358,6 +359,7 @@ func convertPullRequestHook(src *pullRequestHook) *scm.PullRequestHook {
358359

359360
func convertDeploymentHook(src *deploymentHook) *scm.DeployHook {
360361
dst := &scm.DeployHook{
362+
Link: src.Deployment.URL.String,
361363
Data: src.Deployment.Payload,
362364
Desc: src.Deployment.Description.String,
363365
Ref: scm.Reference{

scm/webhook.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ type (
111111
Target string
112112
TargetURL string
113113
Task string
114+
Link string
114115
}
115116

116117
// SecretFunc provides the Webhook parser with the

0 commit comments

Comments
 (0)