File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -45,7 +45,7 @@ module.exports = async ({ github, context }) => {
45
45
console . log ( `Score: ${ score } ` ) ;
46
46
47
47
// Tạo dòng mới để thêm vào bảng
48
- const newEntry = `| ${ score } | [<img src="${ issue . author . avatarUrl } " alt="${ issue . author . login } " width="24" /> ${ name } ](${ githubLink } ) | ${ message } | ${ new Date ( issue . updatedAt ) . toLocaleString ( 'en-US' , { timeZone : 'Asia/Ho_Chi_Minh' } ) } |` ;
48
+ const newEntry = `| ${ score } | [<img src="${ issue . author . avatarUrl } " alt="${ issue . author . login } " width="24" /> ${ name } ](${ githubLink } ) | ${ message } | ${ new Date ( issue . updatedAt ) . toLocaleString ( 'en-US' , { timeZone : 'Asia/Ho_Chi_Minh' } ) } |\n` ;
49
49
50
50
const fileSystem = require ( 'fs' ) ;
51
51
const readmePath = 'README.md' ;
@@ -55,8 +55,8 @@ module.exports = async ({ github, context }) => {
55
55
const leaderboardSection = / < ! - - L e a d e r b o a r d - - > [ \s \S ] * ?< ! - - \/ L e a d e r b o a r d - - > / . exec ( readme ) ;
56
56
57
57
if ( leaderboardSection ) {
58
- // Tìm vị trí của tiêu đề trong bảng
59
- const headerMatch = / ( \| S c o r e \| [ \s \S ] * ? \ | D a t e \| ) / . exec ( leaderboardSection [ 0 ] ) ;
58
+ // Tìm vị trí của tiêu đề và dòng phân cách trong bảng
59
+ const headerMatch = / ( \| S c o r e \| P l a y e r \| M e s s a g e \ | D a t e \| \n \| - - - - - - - \| - - - - - - - - \| - - - - - - - - - \| - - - - - - \| ) / . exec ( leaderboardSection [ 0 ] ) ;
60
60
61
61
if ( headerMatch ) {
62
62
// Chèn newEntry ngay dưới tiêu đề
You can’t perform that action at this time.
0 commit comments