Skip to content

Commit

Permalink
🎯 Update updateLeaderboard.js
Browse files Browse the repository at this point in the history
change "1" to "####"
  • Loading branch information
ChunhThanhDe authored Oct 29, 2024
1 parent 73286c0 commit ad9dfa3
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions .github/updateLeaderboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -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*<!--START_SECTION:Name-->(.*?)<!--END_SECTION:Name-->/s.exec(curr.bodyText);
const githubLinkMatch = /2. 🔗 **GitHub Profile Link**:\s*<!--START_SECTION:GitHub-->(.*?)<!--END_SECTION:GitHub-->/s.exec(curr.bodyText);
const messageMatch = /3. 💬 **Message**:\s*<!--START_SECTION:Message-->(.*?)<!--END_SECTION:Message-->/s.exec(curr.bodyText);
const nameMatch = /#### 👤 **Name**:\s*<!--START_SECTION:Name-->(.*?)<!--END_SECTION:Name-->/s.exec(curr.bodyText);
const githubLinkMatch = /#### 🔗 **GitHub Profile Link**:\s*<!--START_SECTION:GitHub-->(.*?)<!--END_SECTION:GitHub-->/s.exec(curr.bodyText);
const messageMatch = /#### 💬 **Message**:\s*<!--START_SECTION:Message-->(.*?)<!--END_SECTION:Message-->/s.exec(curr.bodyText);
const screenshotMatch = /#### 🖼 **Screenshot**\s*<!--START_SECTION:Screenshot-->(.*?)<!--END_SECTION:Screenshot-->/s.exec(curr.bodyText);

const name = nameMatch ? nameMatch[1].trim() : 'Unknown';
Expand All @@ -60,4 +60,4 @@ module.exports = async ({ github, context }) => {
// Update leaderboard section
const updatedContent = readme.replace(/(?<=<!-- Leaderboard -->.*\n)[\S\s]*?(?=<!-- \/Leaderboard -->|$(?![\n]))/gm, renderComments(result.repository.issue.comments.nodes));
fileSystem.writeFileSync(readmePath, updatedContent, 'utf8');
};
};

0 comments on commit ad9dfa3

Please sign in to comment.