From ad9dfa3cafd673144c6443c91447edc9533ee4af Mon Sep 17 00:00:00 2001 From: Chung Nguyen Thanh Date: Tue, 29 Oct 2024 15:13:45 +0700 Subject: [PATCH] :dart: Update updateLeaderboard.js change "1" to "####" --- .github/updateLeaderboard.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/updateLeaderboard.js b/.github/updateLeaderboard.js index be78605..c9c2bc2 100644 --- a/.github/updateLeaderboard.js +++ b/.github/updateLeaderboard.js @@ -39,9 +39,9 @@ module.exports = async ({ github, context }) => { let date = new Date(curr.updatedAt); let formattedDate = date.toLocaleString('en-US', { timeZone: 'Asia/Ho_Chi_Minh' }); - const nameMatch = /1. 👤 **Name**:\s*(.*?)/s.exec(curr.bodyText); - const githubLinkMatch = /2. 🔗 **GitHub Profile Link**:\s*(.*?)/s.exec(curr.bodyText); - const messageMatch = /3. 💬 **Message**:\s*(.*?)/s.exec(curr.bodyText); + const nameMatch = /#### 👤 **Name**:\s*(.*?)/s.exec(curr.bodyText); + const githubLinkMatch = /#### 🔗 **GitHub Profile Link**:\s*(.*?)/s.exec(curr.bodyText); + const messageMatch = /#### 💬 **Message**:\s*(.*?)/s.exec(curr.bodyText); const screenshotMatch = /#### 🖼️ **Screenshot**\s*(.*?)/s.exec(curr.bodyText); const name = nameMatch ? nameMatch[1].trim() : 'Unknown'; @@ -60,4 +60,4 @@ module.exports = async ({ github, context }) => { // Update leaderboard section const updatedContent = readme.replace(/(?<=.*\n)[\S\s]*?(?=|$(?![\n]))/gm, renderComments(result.repository.issue.comments.nodes)); fileSystem.writeFileSync(readmePath, updatedContent, 'utf8'); - }; +};