【发布时间】:2018-11-17 06:44:37
【问题描述】:
如何在管道中运行的作业中找到分支名称?
我试过 git branch 我得到的只是 * (detached from <commit number>)
master
【问题讨论】:
-
这意味着您不再在特定的分支上,而是在没有分支指向它的特定提交上。你以前跑什么?
-
.gitlab-ci.yml 在管道中运行的脚本。
如何在管道中运行的作业中找到分支名称?
我试过 git branch 我得到的只是 * (detached from <commit number>)
master
【问题讨论】:
有一个名为CI_BUILD_REF_NAME 的预定义变量包含分支名称。欲了解更多信息here
【讨论】: