1
0
mirror of https://github.com/woodpecker-ci/woodpecker.git synced 2024-12-24 10:07:21 +02:00

Fix panic if forge is unreachable (#3944)

This commit is contained in:
qwerty287 2024-07-20 11:46:51 +02:00 committed by GitHub
parent 54b91db6b0
commit 8e2ff338d8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -64,7 +64,11 @@ func CreatePipeline(c *gin.Context) {
user := session.User(c)
lastCommit, _ := _forge.BranchHead(c, user, repo, opts.Branch)
lastCommit, err := _forge.BranchHead(c, user, repo, opts.Branch)
if err != nil {
_ = c.AbortWithError(http.StatusInternalServerError, fmt.Errorf("could not fetch branch head: %w", err))
return
}
tmpPipeline := createTmpPipeline(model.EventManual, lastCommit, user, &opts)