Skip to content

Commit

Permalink
🔖 update scrip
Browse files Browse the repository at this point in the history
  • Loading branch information
ChunhThanhDe committed Nov 4, 2024
1 parent 7f1608b commit cfdc0fc
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 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 }) => {
const winMatch = /Win:\s*(\d+)/.exec(issue.title);

// Extract values or fallback to author details if null
const name = nameMatch ? nameMatch[1].trim() : issue.author.login;
const githubLink = githubLinkMatch ? githubLinkMatch[1].trim() : issue.author.url;
const message = messageMatch ? messageMatch[1].trim() : '';
const name = nameMatch && nameMatch[1].trim() !== '' ? nameMatch[1].trim() : issue.author.login;
const githubLink = githubLinkMatch && githubLinkMatch[1].trim() !== '' ? githubLinkMatch[1].trim() : issue.author.url;
const message = messageMatch ? messageMatch[1].trim() : 'Happy playing 🎉 !!!';
const score = scoreMatch ? parseInt(scoreMatch[1].trim()) : null;
const date = dateMatch ? dateMatch[1].trim() : null;
const mode = modeMatch ? parseInt(modeMatch[1].trim()) : null;
Expand Down

0 comments on commit cfdc0fc

Please sign in to comment.