From 46c745ee68e17dd4a40283356d52690d94d2dad9 Mon Sep 17 00:00:00 2001 From: Jordan Brockopp Date: Mon, 17 Feb 2020 09:00:15 -0600 Subject: [PATCH] fix: hash used for webhook secret (#104) --- api/repo.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/api/repo.go b/api/repo.go index c8c7f4570..ed1f2d0f7 100644 --- a/api/repo.go +++ b/api/repo.go @@ -109,6 +109,12 @@ func CreateRepo(c *gin.Context) { return } + // check if the repo already has a hash created + if len(r.GetHash()) > 0 { + // overwrite the new repo hash with the existing repo hash + input.SetHash(r.GetHash()) + } + // send API call to create the webhook url, err := source.FromContext(c).Enable(u, input.GetOrg(), input.GetName(), input.GetHash()) if err != nil {