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:
Jan Sandquist 2022-09-21 13:13:20 +02:00 коммит произвёл GitHub
Родитель fd2778124d
Коммит 0d6240b9bf
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
1 изменённых файлов: 3 добавлений и 1 удалений

Просмотреть файл

@ -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 }