Skip to content

Commit

Permalink
Added special handling for file details section
Browse files Browse the repository at this point in the history
  • Loading branch information
AdmiringWorm committed Jun 3, 2022
1 parent 08e2f60 commit 05bec0a
Showing 1 changed file with 19 additions and 2 deletions.
21 changes: 19 additions & 2 deletions scripts/public/Test-NewIssue.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -133,18 +133,35 @@ function Test-NewIssue {
$warnings = $validationData.messages | Where-Object type -EQ ([MessageType]::Warning)
if ($warnings) {
$commentBody += "`n`n" + [ValidationMessages]::noticesHeader
$detailsComment = ""
$warnings | ForEach-Object {
$commentBody += "`n- $($_.message)"
# When using the <details> section, special handling is needed
if ($_.message -match "\<details\>") {
$detailsComment = $_.message
}
else {
$commentBody += "`n- $($_.message)"
}
}
$commentBody += "`n`n$detailsComment"
}
}

$infos = $validationData.messages | Where-Object type -EQ ([MessageType]::Info)
if ($infos) {
$commentBody += "`n`n" + [ValidationMessages]::maintainersHeader
$detailsComment = ""
$infos | ForEach-Object {
$commentBody += "`n- $($_.message)"
# When using the <details> section, special handling is needed
if ($_.message -match "\<details\>") {
$detailsComment = $_.message
}
else {
$commentBody += "`n- $($_.message)"
}
}

$commentBody += "`n`n$detailsComment"
}

$commentBody += [ValidationMessages]::commentBodyFooter
Expand Down

0 comments on commit 05bec0a

Please sign in to comment.