From 131c41134163edcb67154739cac7ab7293f87c77 Mon Sep 17 00:00:00 2001 From: Jason Naylor Date: Tue, 19 May 2026 10:09:26 -0700 Subject: [PATCH] Fix clean-up artifact comment bug on 0 comments Co-Authored-By: Claude Opus 4.6 --- Build/Agent/Build-RenderArtifactComment.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Build/Agent/Build-RenderArtifactComment.ps1 b/Build/Agent/Build-RenderArtifactComment.ps1 index 87bdddd781..ef72834389 100644 --- a/Build/Agent/Build-RenderArtifactComment.ps1 +++ b/Build/Agent/Build-RenderArtifactComment.ps1 @@ -122,7 +122,7 @@ function Get-PreviousCommentBody { $owner = $repositoryParts[0] $repo = $repositoryParts[1] $commentsUri = "$GitHubApiUrl/repos/$owner/$repo/issues/$pullRequestNumber/comments?per_page=100" - $comments = @(Invoke-GitHubApi -Method Get -Uri $commentsUri) + $comments = @(Invoke-GitHubApi -Method Get -Uri $commentsUri) | Where-Object { $null -ne $_ } $latestMatchingCommentBody = $null foreach ($comment in $comments) { if ($comment.body -and $comment.body.Contains($StickyCommentMarker)) {