@@ -54,6 +54,49 @@ public WebHookController(IDingTalkService dingTalkService, ILogger<WebHookContro
5454 _ => ""
5555 } ;
5656 /// <summary>
57+ /// 发布部署等待审批
58+ /// </summary>
59+ /// <param name="request"></param>
60+ /// <returns></returns>
61+ [ HttpPost ]
62+ public async Task < IActionResult > ReleaseUpdated ( [ FromBody ] WebHooksRequestPullRequestUpdatedResource request )
63+ {
64+ /*
65+ {
66+ "id": "487c2c58-a83c-44c1-8732-3c99975defb2",
67+ "eventType": "ms.vss-release.deployment-approval-pending-event",
68+ "publisherId": "rm",
69+ "message": {
70+ "text": "阶段 prod 上的发布 2109011 尚待 预先部署 审批。",
71+ "html": "阶段 <a href='https://team.lujing.tech/NewSoftCollection/XXXProject/_release?_a=environment-summary&definitionId=45&definitionEnvironmentId=361'>prod</a> 上的发布 <a href='https://team.lujing.tech/NewSoftCollection/XXXProject/_release?releaseId=17455&_a=release-summary'>2109011</a> 尚待 预先部署 审批。",
72+ "markdown": "[prod](https://team.lujing.tech/NewSoftCollection/XXXProject/_release?_a=environment-summary&definitionId=45&definitionEnvironmentId=361)上的发布 [2109011](https://team.lujing.tech/NewSoftCollection/XXXProject/_release?releaseId=17455&_a=release-summary)尚待 预先部署 审批"
73+ },
74+ "detailedMessage": {
75+ "text": "阶段 prod 上的发布 2109011 尚待 预先部署 审批。\r\n待定位置: 杜建鹏\r\n待定开始时间: 03-September-2021 01:52:24 PM (UTC)",
76+ "html": "阶段 <a href='https://team.lujing.tech/NewSoftCollection/XXXProject/_release?_a=environment-summary&definitionId=45&definitionEnvironmentId=361'>prod</a> 上的发布 <a href='https://team.lujing.tech/NewSoftCollection/XXXProject/_release?releaseId=17455&_a=release-summary'>2109011</a> 尚待 预先部署 审批。<br>待定位置: 杜建鹏<br>待定开始时间: 03-September-2021 01:52:24 PM (UTC)",
77+ "markdown": "阶段 [prod](https://team.lujing.tech/NewSoftCollection/XXXProject/_release?_a=environment-summary&definitionId=45&definitionEnvironmentId=361) 上的发布 [2109011](https://team.lujing.tech/NewSoftCollection/XXXProject/_release?releaseId=17455&_a=release-summary) 尚待 预先部署 审批。\r\n待定位置: 杜建鹏\r\n待定开始时间: 03-September-2021 01:52:24 PM (UTC)"
78+ },
79+ "resource": "由于大小限制,历史记录中不会显示资源详细信息",
80+ "resourceVersion": "3.0-preview.1",
81+ "resourceContainers": {
82+ "collection": {
83+ "id": "196f1fb9-5cca-476e-bf6b-1bfc354d09c7",
84+ "baseUrl": "https://team.lujing.tech/NewSoftCollection/"
85+ },
86+ "server": {
87+ "id": "93ebc1b4-e4e0-4d53-8037-4905cd8a4cb6",
88+ "baseUrl": "https://team.lujing.tech/"
89+ },
90+ "project": {
91+ "id": "4993cbb2-cf7e-4796-9844-9a36b1aec4b3",
92+ "baseUrl": "https://team.lujing.tech/NewSoftCollection/"
93+ }
94+ },
95+ "createdDate": "2021-09-03T13:52:32.171Z"
96+ }*/
97+ return Ok ( ) ;
98+ }
99+ /// <summary>
57100 /// 拉取请求
58101 /// </summary>
59102 /// <param name="dto"></param>
@@ -266,7 +309,7 @@ public async Task<IActionResult> WorkitemUpdated([FromBody] WebHooksRequestInput
266309 o = string . Format ( $ "{{0:{ setting . Format } }}", o ) ;
267310 n = string . Format ( $ "{{0:{ setting . Format } }}", n ) ;
268311 }
269- stringBuilder . AppendLine ( $ "> { setting . Name } : { ch . OldValue } 更改为 { ch . NewValue } ") ;
312+ stringBuilder . AppendLine ( $ "> { setting . Name } : { o } 更改为 { n } ") ;
270313 stringBuilder . AppendLine ( ) ;
271314 }
272315 }
0 commit comments