Skip to content

Commit

Permalink
fix: ref should be branch name for harness code (#288)
Browse files Browse the repository at this point in the history
* fix: ref should be branch name for harness code

* fix: add uid for harness webhook
  • Loading branch information
abhinav-harness authored Dec 20, 2023
1 parent e6556d1 commit 2877ffa
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 3 deletions.
2 changes: 2 additions & 0 deletions scm/driver/harness/repo.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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"`
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"Ref": "aeafa0e2e4ec6909ad75cb8fad57c0b1eb5986e6",
"Ref": "refs/heads/new2",
"Before": "0000000000000000000000000000000000000000",
"After": "aeafa0e2e4ec6909ad75cb8fad57c0b1eb5986e6",
"Repo": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"Ref": "92e21bfcddc1418079cddbb518ad6fd72917798a",
"Ref": "refs/heads/master",
"Before": "a273c385628167932e10caaa58e12550c491f241",
"After": "92e21bfcddc1418079cddbb518ad6fd72917798a",
"Repo": {
Expand Down
2 changes: 1 addition & 1 deletion scm/driver/harness/webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down

0 comments on commit 2877ffa

Please sign in to comment.