diff --git a/api/build/create.go b/api/build/create.go index 7fb97912f..991946c88 100644 --- a/api/build/create.go +++ b/api/build/create.go @@ -342,10 +342,12 @@ func CreateBuild(c *gin.Context) { c.JSON(http.StatusCreated, input) - // send API call to set the status on the commit - err = scm.FromContext(c).Status(ctx, u, input, r.GetOrg(), r.GetName()) - if err != nil { - logger.Errorf("unable to set commit status for build %s/%d: %v", r.GetFullName(), input.GetNumber(), err) + // send API call to set the status on the commit except for scheduled build + if input.GetEvent() != constants.EventSchedule { + err = scm.FromContext(c).Status(ctx, u, input, r.GetOrg(), r.GetName()) + if err != nil { + logger.Errorf("unable to set commit status for build %s/%d: %v", r.GetFullName(), input.GetNumber(), err) + } } // determine queue route diff --git a/api/build/update.go b/api/build/update.go index 566a46360..9c26ae8a7 100644 --- a/api/build/update.go +++ b/api/build/update.go @@ -162,11 +162,12 @@ func UpdateBuild(c *gin.Context) { c.JSON(http.StatusOK, b) // check if the build is in a "final" state - if b.GetStatus() == constants.StatusSuccess || + // and if build is not a scheduled event + if (b.GetStatus() == constants.StatusSuccess || b.GetStatus() == constants.StatusFailure || b.GetStatus() == constants.StatusCanceled || b.GetStatus() == constants.StatusKilled || - b.GetStatus() == constants.StatusError { + b.GetStatus() == constants.StatusError) && b.GetEvent() != constants.EventSchedule { // send API call to capture the repo owner u, err := database.FromContext(c).GetUser(ctx, r.GetUserID()) if err != nil {