From c645874c76192a63cfea1eee73c266970a7ee154 Mon Sep 17 00:00:00 2001 From: FonduemangVI <15520607+FonduemangVI@users.noreply.github.com> Date: Fri, 3 May 2024 16:28:42 +1000 Subject: [PATCH] testing --- .github/scripts/update-contributors-backup.js | 41 +- .github/scripts/update-contributors.js | 25 +- CONTRIBUTORS.md | 487 ------------------ 3 files changed, 39 insertions(+), 514 deletions(-) diff --git a/.github/scripts/update-contributors-backup.js b/.github/scripts/update-contributors-backup.js index 9e7ad8804..c8bf18553 100644 --- a/.github/scripts/update-contributors-backup.js +++ b/.github/scripts/update-contributors-backup.js @@ -1,7 +1,13 @@ const axios = require('axios'); const fs = require('fs'); -let contributors = []; +// Indentation function +function indentString(string, indentation) { + return string.split('\n').map(line => indentation + line).join('\n'); +} + +let contributors = '\n'; +let index = 0; let page = 1; function fetchPage() { @@ -9,21 +15,38 @@ function fetchPage() { .then((response) => { if (response.data.length === 0) { // No more contributors, write the file - fs.writeFileSync('CONTRIBUTORS.json', JSON.stringify(contributors, null, 2)); + if (index % 5 !== 0) { + contributors += '\n'; // Close the row if it's not already closed + } + contributors += '
\n'; + contributors = indentString(contributors, ''); + + fs.writeFileSync('CONTRIBUTORS.md', `## Contributors\n\n\n${contributors}\n\n`); return; } response.data.forEach((user) => { // Exclude bots and actions-user - if (user.type === 'Bot' || user.login.toLowerCase().includes('bot') || user.login === 'actions-user') return; + if (user.type === 'Bot' || user.login.toLowerCase().includes('bot') || user.login === 'actions-user' || user.login === 'mynameisbogdan') return; + + if (index % 5 === 0) { + contributors += ''; + } + + const userHtml = ` + + ${user.login} +
+ ${user.login} +`; + + contributors += indentString(userHtml, ' '); - const userJson = { - "title": user.login, - "image": user.avatar_url, - "url": user.html_url, - }; + if ((index + 1) % 5 === 0 || index === response.data.length - 1) { + contributors += '\n\n'; + } - contributors.push(userJson); + index++; }); // Fetch the next page diff --git a/.github/scripts/update-contributors.js b/.github/scripts/update-contributors.js index c8bf18553..0e24aaba3 100644 --- a/.github/scripts/update-contributors.js +++ b/.github/scripts/update-contributors.js @@ -6,7 +6,7 @@ function indentString(string, indentation) { return string.split('\n').map(line => indentation + line).join('\n'); } -let contributors = '\n'; +let contributors = '
\n'; let index = 0; let page = 1; @@ -15,10 +15,7 @@ function fetchPage() { .then((response) => { if (response.data.length === 0) { // No more contributors, write the file - if (index % 5 !== 0) { - contributors += '\n'; // Close the row if it's not already closed - } - contributors += '
\n'; + contributors += '\n'; contributors = indentString(contributors, ''); fs.writeFileSync('CONTRIBUTORS.md', `## Contributors\n\n\n${contributors}\n\n`); @@ -29,23 +26,15 @@ function fetchPage() { // Exclude bots and actions-user if (user.type === 'Bot' || user.login.toLowerCase().includes('bot') || user.login === 'actions-user' || user.login === 'mynameisbogdan') return; - if (index % 5 === 0) { - contributors += ''; - } - const userHtml = ` - - ${user.login} -
- ${user.login} -`; +
+ ${user.login} +
+ ${user.login} +
`; contributors += indentString(userHtml, ' '); - if ((index + 1) % 5 === 0 || index === response.data.length - 1) { - contributors += '\n\n'; - } - index++; }); diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 1687178e0..e69de29bb 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -1,487 +0,0 @@ -## Contributors - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- TRaSH- -
- TRaSH- -
- yammes08 -
- yammes08 -
- FonduemangVI -
- FonduemangVI -
- NiceTSY -
- NiceTSY -
- nuxencs -
- nuxencs -
- bakerboy448 -
- bakerboy448 -
- Visorask -
- Visorask -
- bokkoman -
- bokkoman -
- nemchik -
- nemchik -
- rg9400 -
- rg9400 -
- andersbjorshol -
- andersbjorshol -
- sadstan -
- sadstan -
- zakkarry -
- zakkarry -
- owine -
- owine -
- rcdailey -
- rcdailey -
- quorn23 -
- quorn23 -
- kantjer01 -
- kantjer01 -
- 4l3-X -
- 4l3-X -
- ItsME6969 -
- ItsME6969 -
- austinwbest -
- austinwbest -
- userdocs -
- userdocs -
- calvinbui -
- calvinbui -
- doob187 -
- doob187 -
- thatbritguy -
- thatbritguy -
- foux -
- foux -
- jasonla -
- jasonla -
- keliansb -
- keliansb -
- Roxedus -
- Roxedus -
- SeiyaGame -
- SeiyaGame -
- saltydk -
- saltydk -
- mizz141 -
- mizz141 -
- Kuredant -
- Kuredant -
- jsatk -
- jsatk -
- fabricionaweb -
- fabricionaweb -
- Davo1624 -
- Davo1624 -
- brettpetch -
- brettpetch -
- 8a8al00ey -
- 8a8al00ey -
- voltron4lyfe -
- voltron4lyfe -
- Opt6 -
- Opt6 -
- KnifeFed -
- KnifeFed -
- Appoxo -
- Appoxo -
- Feramance -
- Feramance -
- Getn67 -
- Getn67 -
- kdbruin -
- kdbruin -
- andrew-kennedy -
- andrew-kennedy -
- appiekap653 -
- appiekap653 -
- Drapersniper -
- Drapersniper -
- MattSidney -
- MattSidney -
- mkatsevVR -
- mkatsevVR -
- aljohn92 -
- aljohn92 -
- mirolm -
- mirolm -
- mrhotio -
- mrhotio -
- mvanbaak -
- mvanbaak -
- bobokun -
- bobokun -
- ToXinE -
- ToXinE -
- ryanwalder -
- ryanwalder -
- Qstick -
- Qstick -
- qsuicide -
- qsuicide -
- Plancke -
- Plancke -
- pdcamilleri -
- pdcamilleri -
- ehippy -
- ehippy -
- patrick-5546 -
- patrick-5546 -
- datcactus -
- datcactus -
- cynicalgeek -
- cynicalgeek -
- garypiner -
- garypiner -
- TESTPERSONAL -
- TESTPERSONAL -
- lundwall -
- lundwall -
- p5nbTgip0r -
- p5nbTgip0r -
- snowballramen -
- snowballramen -
- s0up4200 -
- s0up4200 -
- thezoggy -
- thezoggy -
- 2fst4u -
- 2fst4u -
- AN1MATEK -
- AN1MATEK -
- nickavem -
- nickavem -
- AvAars -
- AvAars -
- briandipalma -
- briandipalma -
- ChaseBro -
- ChaseBro -
- ColinHebert -
- ColinHebert -
- dako98 -
- dako98 -
- DiscDuck -
- DiscDuck -
- Seros -
- Seros -
- JackGameer -
- JackGameer -
- jalmansor -
- jalmansor -
- jwoodhouse -
- jwoodhouse -
- jonasgeiler -
- jonasgeiler -
- KaitoKid -
- KaitoKid -
- kaiserbh -
- kaiserbh -
- maximuskowalski -
- maximuskowalski -
- nmcc1212 -
- nmcc1212 -
- -