Skip to content

Commit

Permalink
fix: changing ProcessWebhook so that the deployment ref is only set o…
Browse files Browse the repository at this point in the history
…nce (#1054)

Co-authored-by: Claire.Nicholas <Z00B3R3@w6nxmk4t6t.target.com>
  • Loading branch information
claire1618 and Claire.Nicholas committed Feb 2, 2024
1 parent b4d810d commit f2f177c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
2 changes: 0 additions & 2 deletions scm/github/webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -412,8 +412,6 @@ func (c *client) processDeploymentEvent(h *library.Hook, payload *github.Deploym
fmt.Sprintf("https://%s/%s/settings/hooks", h.GetHost(), r.GetFullName()),
)

d.SetRef(b.GetRef())

return &types.Webhook{
Hook: h,
Repo: r,
Expand Down
4 changes: 2 additions & 2 deletions scm/github/webhook_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -565,7 +565,7 @@ func TestGithub_ProcessWebhook_Deployment(t *testing.T) {
wantDeployment.SetNumber(145988746)
wantDeployment.SetURL("https://api.github.com/repos/Codertocat/Hello-World/deployments/145988746")
wantDeployment.SetCommit("f95f852bd8fca8fcc58a9a2d6c842781e32a215e")
wantDeployment.SetRef("refs/heads/main")
wantDeployment.SetRef("main")
wantDeployment.SetTask("deploy")
wantDeployment.SetTarget("production")
wantDeployment.SetDescription("")
Expand Down Expand Up @@ -698,7 +698,7 @@ func TestGithub_ProcessWebhook_Deployment_Commit(t *testing.T) {
wantDeployment.SetNumber(145988746)
wantDeployment.SetURL("https://api.github.com/repos/Codertocat/Hello-World/deployments/145988746")
wantDeployment.SetCommit("f95f852bd8fca8fcc58a9a2d6c842781e32a215e")
wantDeployment.SetRef("refs/heads/main")
wantDeployment.SetRef("f95f852bd8fca8fcc58a9a2d6c842781e32a215e")
wantDeployment.SetTask("deploy")
wantDeployment.SetTarget("production")
wantDeployment.SetDescription("")
Expand Down

0 comments on commit f2f177c

Please sign in to comment.