我在jenkins中使用了通用的webhook,我的webhook只需要基于提交。webhook发送给json的是“refs/heads/cli_test”。我想使用groovy脚本在jenkins中只提取分支名称,即cli_test
6yt4nkrj1#
我们可以使用minus函数删除字符串中不需要的内容。
BRANCH = "refs/heads/cli_test" String branch = BRANCH.minus("refs/heads/")
1条答案
按热度按时间6yt4nkrj1#
我们可以使用minus函数删除字符串中不需要的内容。