Skip to content

Commit 7ade13e

Browse files
committed
fix: guestbook regex
1 parent 17d9475 commit 7ade13e

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎.github/workflows/guestbook.yml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,13 @@ jobs:
4040
const result = await github.graphql(query, variables)
4141
const renderComments = (comments) => {
4242
return comments.reduce((prev, curr) => {
43-
return `${prev}|${curr.author.login}|Date|${curr.bodyText}|\n`;
43+
return `${prev}|${curr.author.login}|${curr.updatedAt}|${curr.bodyText}|\n`;
4444
}, "| Name | Date | Message |\n|---|---|---|\n");
4545
};
4646
4747
const fileSystem = require('fs');
4848
const readme = fileSystem.readFileSync('README.md', 'utf8');
49-
fileSystem.writeFileSync('README.md', readme.replace(/(?<=## Guestbook\n)[\S\s]*?(?=#|$(?![\n]))/gm, renderComments(result.repository.issue.comments.nodes)), 'utf8');
49+
fileSystem.writeFileSync('README.md', readme.replace(/(?<=## Guestbook.*\n)[\S\s]*?(?=#|$(?![\n]))/gm, renderComments(result.repository.issue.comments.nodes)), 'utf8');
5050
- name: Push guestbook update
5151
run: |
5252
git config --global user.name 'Github Actions'

0 commit comments

Comments
 (0)