@@ -143,7 +143,7 @@ if ($Kudos.Count -ne 0) {
143143 - AutoSize - Wrap
144144 Write-Host " ##vso[task.logissue type=warning;]Good job! The coverage increased, please update your projects"
145145
146- $KudosMarkdown = @ (' :tada: **Good job! The coverage increased** :tada:' , ' ' , ' | Project | Expected | Actual |' , ' | --- | ---: | ---: |' , $KudosMarkdown , ' ' );
146+ $KudosMarkdown = @ (' :tada: **Good job! The coverage increased** :tada:' , " `r`n " , ' | Project | Expected | Actual |' , ' | --- | ---: | ---: |' , $KudosMarkdown , " `r`n`r`n " );
147147}
148148
149149if ($Errors.Count -ne 0 ) {
@@ -156,7 +156,7 @@ if ($Errors.Count -ne 0) {
156156 @ { Name = " Coverage Type" ; Expression = " Coverage Type" ; Width = 10 ; Alignment = " Center" } `
157157 - AutoSize - Wrap
158158
159- $ErrorsMarkdown = @ (" :exclamation: **Found $ ( $Errors.Count ) issues** :exclamation: " , ' ' , ' | Project | Coverage Type |Expected | Actual | ' , ' | --- | :---: | ---: | ---: |' , $ErrorsMarkdown );
159+ $ErrorsMarkdown = @ (" :exclamation: **Found $ ( $Errors.Count ) issues** :exclamation: " , " `r`n " , ' | Project | Coverage Type |Expected | Actual | ' , ' | --- | :---: | ---: | ---: |' , $ErrorsMarkdown , " `r`n`r`n " );
160160}
161161
162162# Write out markdown for publishing back to AzDO
@@ -167,7 +167,15 @@ $KudosMarkdown | Out-File coverage-report.md -Encoding ascii -Append
167167# Set the AzDO variable used by GitHubComment@0 task
168168[string ]$markdown = Get-Content coverage- report.md - Raw
169169if (! [string ]::IsNullOrWhiteSpace($markdown )) {
170- $gitHubCommentVar = ' ##vso[task.setvariable variable=GITHUB_COMMENT]' + $markdown.Replace (" `n " , " %0D%0A" )
170+ # Add link back to the Code Coverage board
171+ $link = " $ ( $env: SYSTEM_COLLECTIONURI ) $env: SYSTEM_TEAMPROJECT /_build/results?buildId=$env: BUILD_BUILDID &view=codecoverage-tab"
172+ $markdown = " $markdown `n`n Full code coverage report: $link "
173+
174+ Write-Host " ---- GitHub comment ---"
175+ Write-Host $markdown
176+ Write-Host " ---- GitHub comment ---"
177+
178+ $gitHubCommentVar = ' ##vso[task.setvariable variable=GITHUB_COMMENT]' + $markdown.Replace (" `r`n " , " `n " ).Replace(" `n " , " %0D%0A" )
171179 Write-Host $gitHubCommentVar
172180}
173181
0 commit comments