Label event matching
This syntax is supported by the trigger property on the
CI plugin and Smart pipelines plugin.
Shorthand matcher
label:removed:Env matches when a removed label has:
name === "Env", orvalue === "Env"
Examples
Here are a few examples of the syntax on how to match label events based on your needs:
label:removed:Env // matches name or value
label:removed:{name:'Env'} // name only
label:removed:{value:'myValue1'} // value only
label:removed:{name:'Env',value:'myValue1'} // name and value
You can also have more elaborated matches:
label:added:[{name:'test1'},{name:'test2'}] // both labels added
label:added:[{name:"test1"}],removed:[{name:"some other label"}] // adding and removing at the same time
How combined matches work
- Array entries are matched as an
AND(all entries must be present). addedandremovedin the same expression are also matched as anAND.- Empty arrays are supported. For example,
removed:[]means no removed labels.
Usage in plugin config
import {const configure: (config: Config | (() => Config)) => voidconfigure} from "flowie.app"
import {const ci: OptionsPlugin<CiPluginOptions, false>ci, const pipelines: OptionsPluginNoDefault<PipelinesPluginOptions, false>pipelines} from "flowie.app/plugins"
function configure(config: Config | (() => Config)): voidconfigure({
Config.plugins?: PluginDef<unknown>[] | undefinedplugins: [
function ci(options: CiPluginOptions): PluginDef<CiPluginOptions> (+2 overloads)ci({
webhook?: RegExp | undefinedwebhook: /jenkins/,
trigger?: (RunTriggerEvent | "source_updated")[] | undefinedtrigger: [
"label:added:[{name:'test1'},{name:'test2'}]",
'label:added:[{name:"test1"}],removed:[{name:"some other label"}]',
],
}),
function pipelines(options: PipelinesPluginOptions): PluginDef<PipelinesPluginOptions> (+1 overload)pipelines({
run: "custom:integration_tests"run: "custom:integration_tests",
trigger?: RunTriggerEvent[] | undefinedtrigger: ["label:removed:{name:'Env',value:'myValue1'}"],
}),
],
})