You've already forked woodpecker
mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2025-07-12 22:21:40 +02:00
Add DeletePipeline API (#3506)
This is just a first step, the final goal is to have an API endpoint to prune Repo Pipelines older than the given date. @woodpecker-ci/maintainers Can I get some feedback if this is the right direction? --------- Co-authored-by: 6543 <m.huber@kithara.com>
This commit is contained in:
@ -64,3 +64,14 @@ func refreshUserToken(c *gin.Context, user *model.User) {
|
||||
}
|
||||
forge.Refresh(c, _forge, _store, user)
|
||||
}
|
||||
|
||||
// pipelineDeleteAllowed checks if the given pipeline can be deleted based on its status.
|
||||
// It returns a bool indicating if delete is allowed, and the pipeline's status.
|
||||
func pipelineDeleteAllowed(pl *model.Pipeline) bool {
|
||||
switch pl.Status {
|
||||
case model.StatusRunning, model.StatusPending, model.StatusBlocked:
|
||||
return false
|
||||
}
|
||||
|
||||
return true
|
||||
}
|
||||
|
Reference in New Issue
Block a user