Skip to content

Commit 2b3d21d

Browse files
Clean-up artifact comment bug on 0 comments (#897)
Adjust script for making sure that comments are cleared if problems are resolved so it can handle the absence of previous problems Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
1 parent a148891 commit 2b3d21d

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

Build/Agent/Build-RenderArtifactComment.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ function Get-PreviousCommentBody {
122122
$owner = $repositoryParts[0]
123123
$repo = $repositoryParts[1]
124124
$commentsUri = "$GitHubApiUrl/repos/$owner/$repo/issues/$pullRequestNumber/comments?per_page=100"
125-
$comments = @(Invoke-GitHubApi -Method Get -Uri $commentsUri)
125+
$comments = @(Invoke-GitHubApi -Method Get -Uri $commentsUri) | Where-Object { $null -ne $_ }
126126
$latestMatchingCommentBody = $null
127127
foreach ($comment in $comments) {
128128
if ($comment.body -and $comment.body.Contains($StickyCommentMarker)) {

0 commit comments

Comments
 (0)