2

我正在尝试在 VSTS 中为我​​的项目构建 CI/CD 管道。测试、构建和部署流程都很好并且按预期工作。

但我无法将 package.json 中自动增加的版本号提交到 github repo。

我在 VSTS 代理上的步骤与此图像一致。 在此处输入图像描述

我在增加版本号步骤中编写了以下 npm 脚本来增加次要版本号。

git config user.email "ttcgabc123@gmail.com"
git config user.name "ttcg"

npm version minor

git commit
git push origin master --tags

它确实将版本号从 0.2.0 增加到 0.3.0,但是它不会将所做的更改推送回我的 github 存储库,我无法提交/推送这些更改。

请在 VSTS 构建中查看上述步骤的输出。在线编号 12、可以看到新的版本号。

在此处输入图像描述

我尝试使用git remote add origin https://github.com/ttcg/react-workout-diary.git,但它显示错误消息fatal: remote origin already exists.

您能否告诉我如何自动增加 CI/CD 管道中的版本号?

4

0 回答 0