Skip to content

Commit bbe7bd7

Browse files
committed
Bug fixes to the commenting workflow.
1 parent f66cdb3 commit bbe7bd7

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

.github/workflows/pull-request-comments.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,9 @@ jobs:
231231

232232
- name: Leave a comment with any differences noticed
233233
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
234+
env:
235+
RUN_ID:
236+
${{ github.event.workflow_run.id }}
234237
with:
235238
script: |
236239
const fs = require( 'fs' );
@@ -263,19 +266,19 @@ jobs:
263266
const comments = ( await github.rest.issues.listComments( commentInfo ) ).data;
264267
265268
for ( const currentComment of comments ) {
266-
if ( currentComment.user.type === 'Bot' && currentComment.body.includes( 'Build Script Results Comparison' ) ) {
269+
if ( currentComment.user.type === 'Bot' && currentComment.body.includes( 'Build Server Comparison' ) ) {
267270
commentInfo.comment_id = currentComment.id;
268271
break;
269272
}
270273
};
271274
272-
commentInfo.body = '## Build Server Comparison';
275+
commentInfo.body = "## Build Server Comparison\n\n";
273276
274277
// Post or update the comment.
275278
if ( fileChanges.trim() === '' ) {
276279
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.';
277280
} 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.
281+
commentInfo.body += `The contents of the \`build\` directory after running \`npm run build\` has been compared with the contents of the WordPress/WordPress repository.
279282
280283
**Review these differences carefully for any unexpected results.**
281284

0 commit comments

Comments
 (0)