
我正在努力在某个阶段创建一个作业,以确定特定 git 提交是否在特定目录中有任何文件更改。如果是,我想运行另一个作业。
我在 bash 任务中尝试了以下操作:
- 任务:Bash@3 输入:targetType:'inline' awsCredentials:${{parameters.awsCredentials}} workingDirectory:envs/${{parameters.environment}} 脚本:| commitid=
git rev-parse --short=7 HEAD
changes=git diff-tree --no-commit-id --name-only -r $commitid| grep $(basename $PWD)
上述更改正在我的工作站上运行,但当我在管道任务中回显 $commitid 时它没有返回任何内容。