diff --git a/scm/driver/harness/repo.go b/scm/driver/harness/repo.go index da4237555..b467a03db 100644 --- a/scm/driver/harness/repo.go +++ b/scm/driver/harness/repo.go @@ -75,6 +75,7 @@ func (s *repositoryService) CreateHook(ctx context.Context, repo string, input * in := new(hook) in.Enabled = true in.DisplayName = input.Name + in.UID = input.Name in.Secret = input.Secret in.Insecure = input.SkipVerify in.URL = input.Target @@ -134,6 +135,7 @@ type ( HasSecret bool `json:"has_secret"` Secret string `json:"secret"` ID int `json:"id"` + UID string `json:"uid"` Insecure bool `json:"insecure"` LatestExecutionResult string `json:"latest_execution_result"` ParentID int `json:"parent_id"` diff --git a/scm/driver/harness/testdata/webhooks/branch_create.json.golden b/scm/driver/harness/testdata/webhooks/branch_create.json.golden index 9bc611b39..a534de4c2 100644 --- a/scm/driver/harness/testdata/webhooks/branch_create.json.golden +++ b/scm/driver/harness/testdata/webhooks/branch_create.json.golden @@ -1,5 +1,5 @@ { - "Ref": "aeafa0e2e4ec6909ad75cb8fad57c0b1eb5986e6", + "Ref": "refs/heads/new2", "Before": "0000000000000000000000000000000000000000", "After": "aeafa0e2e4ec6909ad75cb8fad57c0b1eb5986e6", "Repo": { diff --git a/scm/driver/harness/testdata/webhooks/branch_updated.json.golden b/scm/driver/harness/testdata/webhooks/branch_updated.json.golden index 1537f8d87..550cf3b1d 100644 --- a/scm/driver/harness/testdata/webhooks/branch_updated.json.golden +++ b/scm/driver/harness/testdata/webhooks/branch_updated.json.golden @@ -1,5 +1,5 @@ { - "Ref": "92e21bfcddc1418079cddbb518ad6fd72917798a", + "Ref": "refs/heads/master", "Before": "a273c385628167932e10caaa58e12550c491f241", "After": "92e21bfcddc1418079cddbb518ad6fd72917798a", "Repo": { diff --git a/scm/driver/harness/webhook.go b/scm/driver/harness/webhook.go index d1ce064fd..183650dd9 100644 --- a/scm/driver/harness/webhook.go +++ b/scm/driver/harness/webhook.go @@ -219,7 +219,7 @@ func convertPullRequestHook(src *pullRequestHook) *scm.PullRequestHook { func convertPushHook(src *pushHook) *scm.PushHook { return &scm.PushHook{ - Ref: src.Sha, + Ref: src.Ref.Name, Before: src.OldSha, After: src.Sha, Repo: convertRepo(src.Repo),