From 16359db8743d10b46603ca6164dd72e1cbd71966 Mon Sep 17 00:00:00 2001 From: FonduemangVI <15520607+FonduemangVI@users.noreply.github.com> Date: Mon, 20 May 2024 22:39:43 +1000 Subject: [PATCH] test new script changes --- .github/scripts/update-contributors.js | 26 +++++++++++--------------- 1 file changed, 11 insertions(+), 15 deletions(-) diff --git a/.github/scripts/update-contributors.js b/.github/scripts/update-contributors.js index a30408e5a..a48db9867 100644 --- a/.github/scripts/update-contributors.js +++ b/.github/scripts/update-contributors.js @@ -3,10 +3,10 @@ const fs = require('fs'); // Indentation function function indentString(string, indentation) { - return string.split('\n').map(line => indentation + line).join('\n'); + return string.split('\n').map(line => indentation + line).join('\n').trim(); } -let contributors = '
\n'; +let contributors = '
'; let index = 0; let page = 1; @@ -15,29 +15,25 @@ function fetchPage() { .then((response) => { if (response.data.length === 0) { // No more contributors, write the file - contributors += '
\n'; + contributors += '\n
'; contributors = indentString(contributors, ''); - fs.writeFileSync('CONTRIBUTORS.md', `## Contributors\n\n\n${contributors}\n\n`); + fs.writeFileSync('CONTRIBUTORS.md', `## Contributors\n\n\n${contributors}\n`); return; } - response.data.forEach((user, i) => { + response.data.forEach((user) => { // Exclude bots and actions-user if (user.type === 'Bot' || user.login.toLowerCase().includes('bot') || user.login === 'actions-user' || user.login === 'mynameisbogdan') return; - // Determine row index for background color - const rowIndex = Math.floor(index / 5); - const bgColor = (rowIndex % 2 === 0) ? '#1e2129' : '#303850'; - const userHtml = ` -
- ${user.login} -
- ${user.login} +
+ ${user.login} +
+ ${user.login}
`; - contributors += indentString(userHtml, ' '); + contributors += '\n' + indentString(userHtml, ' '); index++; }); @@ -51,4 +47,4 @@ function fetchPage() { }); } -fetchPage(); \ No newline at end of file +fetchPage();