You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: .github/workflows/pull-request-comments.yml
+22-16Lines changed: 22 additions & 16 deletions
Original file line number
Diff line number
Diff line change
@@ -269,13 +269,20 @@ jobs:
269
269
}
270
270
};
271
271
272
-
commentInfo.body = "## Build Server Comparison\n\n";
273
-
274
272
// Post or update the comment.
275
273
if ( fileChanges.trim() === '' ) {
276
-
commentInfo.body += 'The contents of the `build` directory after running `npm run build` matches the contents of the WordPress/WordPress repository. No differences were found.';
277
-
} else {
278
-
commentInfo.body += `The contents of the \`build\` directory after running \`npm run build\` has been compared with the contents of the WordPress/WordPress repository.
274
+
if ( ! commentInfo.comment_id ) {
275
+
core.info( 'No differences found and no existing comment. Skipping.' );
276
+
return;
277
+
}
278
+
279
+
commentInfo.body = "## Build Server Comparison\n\nThe changes in this pull request will not result in any differences with the WordPress/WordPress repository.";
280
+
github.rest.issues.updateComment( commentInfo );
281
+
return;
282
+
}
283
+
284
+
commentInfo.body = "## Build Server Comparison\n\n";
285
+
commentInfo.body += `The contents of the \`build\` directory after running \`npm run build\` has been compared with the contents of the WordPress/WordPress repository.
279
286
280
287
**Review these differences carefully for any unexpected results.**
0 commit comments