diff --git a/api/build/skip.go b/api/build/skip.go index 2d934fb93..8a6eeeeb7 100644 --- a/api/build/skip.go +++ b/api/build/skip.go @@ -13,25 +13,25 @@ import ( func SkipEmptyBuild(p *pipeline.Build) string { if len(p.Stages) == 1 { if p.Stages[0].Name == "init" { - return "skipping build since only init stage found" + return "skipping build since only init stage found. It is likely no rulesets matched for the webhook payload." } } if len(p.Stages) == 2 { if p.Stages[0].Name == "init" && p.Stages[1].Name == "clone" { - return "skipping build since only init and clone stages found" + return "skipping build since only init and clone stages found. It is likely no rulesets matched for the webhook payload." } } if len(p.Steps) == 1 { if p.Steps[0].Name == "init" { - return "skipping build since only init step found" + return "skipping build since only init step found. It is likely no rulesets matched for the webhook payload." } } if len(p.Steps) == 2 { if p.Steps[0].Name == "init" && p.Steps[1].Name == "clone" { - return "skipping build since only init and clone steps found" + return "skipping build since only init and clone steps found. It is likely no rulesets matched for the webhook payload." } } diff --git a/api/webhook/post.go b/api/webhook/post.go index aa4449194..47562f80f 100644 --- a/api/webhook/post.go +++ b/api/webhook/post.go @@ -532,6 +532,10 @@ func PostWebhook(c *gin.Context) { // set build to successful status b.SetStatus(constants.StatusSkipped) + // set hook status and message + h.SetStatus(constants.StatusSkipped) + h.SetError(skip) + // send API call to set the status on the commit err = scm.FromContext(c).Status(ctx, u, b, repo.GetOrg(), repo.GetName()) if err != nil {