Jenkinsfile get current tag

后端 未结 8 1913
南笙
南笙 2021-02-05 10:15

Is there a way to get the current tag ( or null if there is none ) for a job in a Jenkinsfile? The background is that I only want to build some artifacts ( android APKs ) when t

8条回答
  •  盖世英雄少女心
    2021-02-05 10:48

    If the current build is a tag build -- as in, when { buildingTag() } was "true" -- then the (undocumented) environment variable BRANCH_NAME contains the name of the tag being build.

提交回复
热议问题