mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2024-09-24 12:40:06 +00:00
allow glob expresion in pipeline config for labels
This commit is contained in:
parent
5197af3ddc
commit
43ada66dde
1 changed files with 7 additions and 2 deletions
|
@ -15,6 +15,9 @@
|
|||
package grpc
|
||||
|
||||
import (
|
||||
"github.com/bmatcuk/doublestar/v4"
|
||||
"github.com/rs/zerolog/log"
|
||||
|
||||
"go.woodpecker-ci.org/woodpecker/v2/pipeline/rpc"
|
||||
"go.woodpecker-ci.org/woodpecker/v2/server/model"
|
||||
"go.woodpecker-ci.org/woodpecker/v2/server/queue"
|
||||
|
@ -39,9 +42,11 @@ func createFilterFunc(agentFilter rpc.Filter) queue.FilterFn {
|
|||
continue
|
||||
}
|
||||
|
||||
if taskLabelValue != agentLabelValue {
|
||||
return false
|
||||
match, err := doublestar.Match(taskLabelValue, agentLabelValue)
|
||||
if err != nil {
|
||||
log.Error().Err(err).Msg("got unexpected error while try to match task and agent lable value")
|
||||
}
|
||||
return match
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue