prashanth kool
prashanth kool

Reputation: 31

Issue while triggering jenkins pipeline using github webhooks for specific branch

Trying to trigger Jenkins pipeline using Github webhooks for a specific branch. Pipeline should trigger for a merge commit but having an issue in triggering. Tried it using 'Generic Webhook Trigger' plugin.

If I use ^(refs/heads/release-1.0)$ in optional filters and pipeline is triggering whenever something is merged into release-1.0 branch and pipeline build is successful

But when i used ^(refs/heads/release-)$ in optional filters, the pipeline is not triggering. Here why I am using release- is release branches have tag numbers. For example: release-1.0, release-1.1, release-1.2 and so on.

Can anyone help me with this question.

Upvotes: 1

Views: 666

Answers (1)

Ian W
Ian W

Reputation: 4767

This ^(refs/heads/release-)$ is a regexp, starting (^) with, end ending ($), enclosing specifc text refs/heads/release- .

You need to extend the regexp pattern match, eg: .* or [0-9]*\.[0-9]*, here: release-{here}

From README.md,

This regexp site Also syntax here

Upvotes: 1

Related Questions