diff --git a/cmd/drone-agent/agent.go b/cmd/drone-agent/agent.go index 50264f4f..9e67df4d 100644 --- a/cmd/drone-agent/agent.go +++ b/cmd/drone-agent/agent.go @@ -32,6 +32,7 @@ func loop(c *cli.Context) error { Labels: map[string]string{ "platform": c.String("platform"), }, + Expr: c.String("drone-filter"), } hostname := c.String("hostname") diff --git a/cmd/drone-agent/main.go b/cmd/drone-agent/main.go index 87a2b836..76ae9557 100644 --- a/cmd/drone-agent/main.go +++ b/cmd/drone-agent/main.go @@ -48,6 +48,11 @@ func main() { Name: "platform", Value: "linux/amd64", }, + cli.StringFlag{ + EnvVar: "DRONE_FILTER", + Name: "drone-filter", + Usage: "A filter expression used to restrict builds by label", + }, cli.IntFlag{ EnvVar: "DRONE_MAX_PROCS", Name: "max-procs",