You can use a regular expression to filter out refs you're not interested in. The REG_EXP
comparison type seems to use Java's Pattern, which supports negative lookaheads.
Example expression which doesn't match anything that starts with "refs/": ^(?!refs/).*$
.
Full example for trigger setup (using a scripted pipeline):
properties([
pipelineTriggers([
[
$class : 'GerritTrigger',
gerritProjects : [
[
$class : 'GerritProject',
compareType: 'PLAIN',
pattern : 'my-gerrit-project',
branches : [
[
$class : 'Branch',
compareType: 'REG_EXP',
// does not start with "refs/"
pattern : '^(?!refs/).*$'
]
]
]
],
triggerOnEvents: [
[
$class: 'PluginPatchsetCreatedEvent'
],
[
$class: 'PluginRefUpdatedEvent'
]
]
]
])
])
(I know this is more than 2 years late, but I just ran into this issue, so maybe it helps someone.)