mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2025-01-31 19:52:21 +00:00
do not restart errored build
This commit is contained in:
parent
63ba6af242
commit
45357681a6
1 changed files with 10 additions and 0 deletions
|
@ -474,6 +474,16 @@ func PostBuild(c *gin.Context) {
|
|||
return
|
||||
}
|
||||
|
||||
switch build.Status {
|
||||
case model.StatusPending,
|
||||
model.StatusRunning,
|
||||
model.StatusDeclined,
|
||||
model.StatusBlocked,
|
||||
model.StatusError:
|
||||
c.String(500, "cannot restart a build with status %s", build.Status)
|
||||
return
|
||||
}
|
||||
|
||||
// if the remote has a refresh token, the current access token
|
||||
// may be stale. Therefore, we should refresh prior to dispatching
|
||||
// the job.
|
||||
|
|
Loading…
Reference in a new issue