mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2024-12-26 02:10:31 +00:00
15 lines
319 B
Go
15 lines
319 B
Go
package parser
|
|
|
|
import (
|
|
"github.com/drone/drone/pkg/types"
|
|
|
|
"github.com/drone/drone/Godeps/_workspace/src/gopkg.in/yaml.v2"
|
|
)
|
|
|
|
func ParseCondition(raw string) (*types.Condition, error) {
|
|
c := struct {
|
|
Condition *types.Condition `yaml:"when"`
|
|
}{}
|
|
err := yaml.Unmarshal([]byte(raw), c)
|
|
return c.Condition, err
|
|
}
|