mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2025-06-05 00:48:52 +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
|
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
|
// if the remote has a refresh token, the current access token
|
||||||
// may be stale. Therefore, we should refresh prior to dispatching
|
// may be stale. Therefore, we should refresh prior to dispatching
|
||||||
// the job.
|
// the job.
|
||||||
|
|
Loading…
Reference in a new issue