Skip to content

Commit

Permalink
Merge branch 'main' into feat/otel-tracing
Browse files Browse the repository at this point in the history
  • Loading branch information
plyr4 authored Sep 11, 2024
2 parents cd973d5 + 6750763 commit c95193b
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
7 changes: 7 additions & 0 deletions api/webhook/post.go
Original file line number Diff line number Diff line change
Expand Up @@ -405,8 +405,15 @@ func PostWebhook(c *gin.Context) {
h.SetStatus(constants.StatusFailure)
h.SetError(err.Error())

b.SetStatus(constants.StatusError)

util.HandleError(c, code, err)

err = scm.FromContext(c).Status(ctx, repo.GetOwner(), b, repo.GetOrg(), repo.GetName())
if err != nil {
l.Debugf("unable to set commit status for %s/%d: %v", repo.GetFullName(), b.GetNumber(), err)
}

return
}

Expand Down
9 changes: 8 additions & 1 deletion scm/github/repo.go
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,14 @@ func (c *client) Status(ctx context.Context, u *api.User, b *api.Build, org, nam
description = "build was skipped as no steps/stages found"
default:
state = "error"
description = "there was an error"

// if there is no build, then this status update is from a failed compilation
if b.GetID() == 0 {
description = "error compiling pipeline - check audit for more information"
url = fmt.Sprintf("%s/%s/%s/hooks", c.config.WebUIAddress, org, name)
} else {
description = "there was an error"
}
}

// check if the build event is deployment
Expand Down

0 comments on commit c95193b

Please sign in to comment.