0

我在 azure DevOps 上的 TFS 服务器上有我的代码仓库。在此应用程序的 CI 部分中,我执行了一些操作,然后生成一个文件,假设它是从存储库中的现有版本创建的某种日志文件或报告,但现在我想重新签入我的代码来自构建管道的回购。那么什么是最好的解决方案呢?

4

1 回答 1

1

如果您使用 TFVC 版本控制,您可以调用 REST API Changesets - Create in a powershell task 或 TF Command Checkin 命令在管道中的命令行任务中创建新的变更集。

POST https://dev.azure.com/{organization}/{project}/_apis/tfvc/changesets?api-version=5.0

tf checkin [/author:author name] [/comment:("comment"|@comment file)] 
[/noprompt] [/notes:("Note Name"="note text"|@notefile)] 
[/override:(reason|@reasonfile)] [/recursive] [/saved] [/validate] [itemspec] [/bypass] [/force] [/noautoresolve]  [/login:username,[password]] [/new]

如果您使用 Git 版本控制,您可以调用 REST API Pushes - Create以将更改推送到存储库。

POST https://dev.azure.com/{organization}/{project}/_apis/git/repositories/{repositoryId}/pushes?api-version=5.0

于 2020-08-17T06:49:42.487 回答