Hey all, is there a way to see if a branch in Jenkins endsWith a certain string, . . .

Gearoid Gman Maguire:
hey all, is there a way to see if a branch in Jenkins endsWith a certain string, I know we can check startsWith and contains but would like to know if endsWith is correct

example:
env.TAG_NAME.startsWith('release-') && env.TAG_NAME.endsWith(-beta)

Alistair Mackay:
Hi @Gearoid Gman Maguire

Jenkins pipeline language is built on Groovy, thus any valid groovy is valid jenkins, unless prohibited by the https://www.jenkins.io/doc/book/managing/script-approval/|sandbox

Please see https://www.tutorialspoint.com/groovy/groovy_strings.htm

Gearoid Gman Maguire:
Thanks @Alistair Mackay