【发布时间】:2021-01-22 12:18:02
【问题描述】:
在 gitlab.ci.yml - 试图在最后一个标签之后检查 gitlog 上的提交消息,它的工作原理:
$ git log --oneline -- "instruction/1.0/" $(git describe --tags --abbrev=0 @^)
00:00
5cee88f Add new file - new instruction
26f5e26 Added new blablabla
当我尝试将结果保存在文件中时,它仍然可以正常工作,我们在文件夹中有 test.log
git log --oneline -- "instruction/1.0/" $(git describe --tags --abbrev=0 @^) > test.log
ls
test.log
但是如果我们尝试在文件名中包含 CI var,我们不会得到任何结果(此剧本中其他模块中使用了 $SYSTEM_NAME,一切正常)
git log --oneline -- "instruction/1.0/" $(git describe --tags --abbrev=0 @^) > $SYSTEM_NAME.log
还有其他方法可以在 gitlog 输出中动态使用文件名吗?
【问题讨论】: