0
gitブランチの名前を取得しようとしていますが、次のコードは期待される出力を返しません。Jenkinsパイプラインスクリプト - gitブランチを変更する
def getbranches = ("git ls-remote -h https://github.com/my_repo").execute().getText()
print getbranches.readLines()
.collect { it.split()[1].replaceAll("refs/heads/", "") }
.unique()
.findAll { it.startsWith('r') }
それはのようなものを返す必要があります:リリース/ 1.1をそれは偽を出力します。