From 55e3d0e28b4fa7c0a51f3999c3c273445be77a81 Mon Sep 17 00:00:00 2001 From: "Claire.Nicholas" Date: Tue, 22 Aug 2023 10:35:09 -0500 Subject: [PATCH] enhance: adding a branch field to scheduled builds --- api/schedule/create.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/api/schedule/create.go b/api/schedule/create.go index e7c5b09a0..dc83de0ee 100644 --- a/api/schedule/create.go +++ b/api/schedule/create.go @@ -136,7 +136,12 @@ func CreateSchedule(c *gin.Context) { s.SetCreatedAt(time.Now().UTC().Unix()) s.SetUpdatedAt(time.Now().UTC().Unix()) s.SetUpdatedBy(u.GetName()) - s.SetBranch(input.GetBranch()) + + if input.GetBranch() == "" { + s.SetBranch(*r.Branch) + } else { + s.SetBranch(input.GetBranch()) + } // set the active field based off the input provided if input.Active == nil {