Validate - indicate UTF-8 to avoid null exception when posting WhatIf output as comment to Pull Request (#122)
Indicate UTF-8 to avoid null exception when posting WhatIf output as comment to Pull Request
This commit is contained in:
Родитель
fd2778124d
Коммит
0d6240b9bf
|
@ -59,6 +59,7 @@ jobs:
|
|||
|
||||
- task: PowerShell@2
|
||||
displayName: 'Results'
|
||||
condition: eq(variables['Build.Reason'], 'PullRequest')
|
||||
inputs:
|
||||
targetType: "inline"
|
||||
script: |
|
||||
|
@ -66,7 +67,8 @@ jobs:
|
|||
$uri = "$(System.CollectionUri)/$(System.TeamProject)/_apis/git/repositories/$(Build.Repository.Name)/pullRequests/$(System.PullRequest.PullRequestId)/threads?api-version=6.0"
|
||||
Invoke-RestMethod `
|
||||
-Method Post `
|
||||
-Headers @{ "Authorization" = "Bearer $(System.AccessToken)"; "Content-Type" = "application/json" } `
|
||||
-ContentType "application/json;charset=utf-8" `
|
||||
-Headers @{ "Authorization" = "Bearer $(System.AccessToken)" } `
|
||||
-Body (@{
|
||||
"comments" = @(
|
||||
@{ "parentCommentId" = 0; "content" = "$(Get-Content -Path /tmp/OUTPUT.md -Raw)"; "commentType" = 1 }
|
||||
|
|
Загрузка…
Ссылка в новой задаче