diff --git a/.github/scripts/update-contributors.js b/.github/scripts/update-contributors.js index 241de5dc7..fcc1d8eea 100644 --- a/.github/scripts/update-contributors.js +++ b/.github/scripts/update-contributors.js @@ -6,20 +6,31 @@ function indentString(string, indentation) { return string.split('\n').map(line => indentation + line).join('\n'); } -axios.get('https://api.github.com/repos/FonduemangVI/Guides/contributors') - .then((response) => { - let contributors = '\n'; - let index = 0; +let contributors = '
\n'; +let index = 0; +let page = 1; + +function fetchPage() { + axios.get(`https://api.github.com/repos/FonduemangVI/Guides/contributors?per_page=100&page=${page}`) + .then((response) => { + if (response.data.length === 0) { + // No more contributors, write the file + contributors += '
\n'; + contributors = indentString(contributors, ''); + + fs.writeFileSync('CONTRIBUTORS.md', `## Contributors\n\n\n${contributors}\n\n`); + return; + } - response.data.forEach((user) => { - // Exclude bots - if (user.type === 'Bot' || user.login.toLowerCase().includes('bot')) return; + response.data.forEach((user) => { + // Exclude bots + if (user.type === 'Bot' || user.login.toLowerCase().includes('bot')) return; - if (index % 6 === 0) { - contributors += ''; - } + if (index % 6 === 0) { + contributors += ''; + } - const userHtml = ` + const userHtml = ` ${user.login} @@ -28,20 +39,22 @@ axios.get('https://api.github.com/repos/FonduemangVI/Guides/contributors') `; - contributors += indentString(userHtml, ' '); + contributors += indentString(userHtml, ' '); - if ((index + 1) % 6 === 0 || index === response.data.length - 1) { - contributors += '\n\n'; - } + if ((index + 1) % 6 === 0 || index === response.data.length - 1) { + contributors += '\n\n'; + } - index++; - }); + index++; + }); - contributors += '\n'; - contributors = indentString(contributors, ''); + // Fetch the next page + page++; + fetchPage(); + }) + .catch((error) => { + console.error(`Could not fetch contributors: ${error}`); + }); +} - fs.writeFileSync('CONTRIBUTORS.md', `## Contributors\n\n\n${contributors}\n\n`); - }) - .catch((error) => { - console.error(`Could not fetch contributors: ${error}`); - }); +fetchPage(); diff --git a/.github/workflows/update_contributors2.yml b/.github/workflows/update_contributors2.yml deleted file mode 100644 index 2fa05acfd..000000000 --- a/.github/workflows/update_contributors2.yml +++ /dev/null @@ -1,18 +0,0 @@ -name: Update contributors2 - -on: - push: - branches: - - master - -jobs: - contrib-readme-job: - runs-on: ubuntu-latest - name: A job to automate contribute list in CONTRIBUTORS2.md - steps: - - name: Contribute List - uses: akhilmhdh/contributors-readme-action@v2.3.6 - with: - readme_path: "CONTRIBUTORS2.md" - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/CONTRIBUTORS2.md b/CONTRIBUTORS2.md deleted file mode 100644 index 694cae690..000000000 --- a/CONTRIBUTORS2.md +++ /dev/null @@ -1,659 +0,0 @@ -## Contributors - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - TRaSH- -
- TRaSH -
-
- - yammes08 -
- Null -
-
- - FonduemangVI -
- FonduemangVI -
-
- - NiceTSY -
- NiceTSY -
-
- - nuxencs -
- Nuxen -
-
- - bakerboy448 -
- Null -
-
- - Visorask -
- Null -
-
- - bokkoman -
- Null -
-
- - nemchik -
- Eric Nemchik -
-
- - rg9400 -
- Null -
-
- - andersbjorshol -
- Anders Bjørshol -
-
- - sadstan -
- Sad Stan -
-
- - ImgBotApp -
- Imgbot -
-
- - zakkarry -
- Zakary -
-
- - owine -
- Null -
-
- - rcdailey -
- Robert Dailey -
-
- - quorn23 -
- Gabe -
-
- - kantjer01 -
- Null -
-
- - 4l3-X -
- Alex -
-
- - ItsME6969 -
- Null -
-
- - austinwbest -
- Nitsua -
-
- - userdocs -
- Userdocs -
-
- - mynameisbogdan -
- Bogdan -
-
- - calvinbui -
- Calvin Bui -
-
- - doob187 -
- Null -
-
- - thatbritguy -
- Null -
-
- - SeiyaGame -
- Flavien -
-
- - Roxedus -
- Null -
-
- - keliansb -
- Kélian Saint-Bonnet -
-
- - jasonla -
- Jason La -
-
- - foux -
- François-Xavier Payet -
-
- - 8a8al00ey -
- Null -
-
- - brettpetch -
- Brett Petch -
-
- - Davo1624 -
- Null -
-
- - fabricionaweb -
- Fabricio -
-
- - jsatk -
- Jesse Atkinson -
-
- - Kuredant -
- Null -
-
- - mizz141 -
- Null -
-
- - saltydk -
- Salty -
-
- - voltron4lyfe -
- Null -
-
- - Opt6 -
- Null -
-
- - KnifeFed -
- KnifeFed -
-
- - Appoxo -
- Appoxo -
-
- - Feramance -
- Null -
-
- - Getn67 -
- Null -
-
- - kdbruin -
- Kees De Bruin -
-
- - andrew-kennedy -
- Andrew Kennedy -
-
- - appiekap653 -
- Arjen Hissink -
-
- - Drapersniper -
- Draper -
-
- - MattSidney -
- Null -
-
- - mkatsevVR -
- Max Katsev -
-
- - aljohn92 -
- Null -
-
- - mirolm -
- Miroslav Marchev -
-
- - mrhotio -
- Null -
-
- - mvanbaak -
- Michiel Van Baak Jansen -
-
- - bobokun -
- Null -
-
- - ToXinE -
- Null -
-
- - ryanwalder -
- Ryan Walder -
-
- - Qstick -
- Null -
-
- - qsuicide -
- Q_Suicide -
-
- - Plancke -
- Plancke -
-
- - pdcamilleri -
- Peter Camilleri -
-
- - ehippy -
- Patrick McDavid -
-
- - patrick-5546 -
- Patrick Creighton -
-
- - datcactus -
- Cactus -
-
- - cynicalgeek -
- Null -
-
- - garypiner -
- Null -
-
- - TESTPERSONAL -
- Null -
-
- - lundwall -
- Null -
-
- - p5nbTgip0r -
- Null -
-
- - snowballramen -
- Null -
-
- - s0up4200 -
- Null -
-
- - thezoggy -
- Null -
-
- - 2fst4u -
- Null -
-
- - AN1MATEK -
- Null -
-
- - nickavem -
- Andrew Thurman -
-
- - AvAars -
- Arthur Van Aarssen -
-
- - briandipalma -
- Brian Di Palma -
-
- - ChaseBro -
- Chase Brownell -
-
- - ColinHebert -
- Colin Hebert -
-
- - dako98 -
- Dako Dimov -
-
- - DiscDuck -
- Null -
-
- - Seros -
- Erik Müller -
-
- - JackGameer -
- Jack Taylor -
-
- - jalmansor -
- Jason "Manbeard" Al-Mansor -
-
- - jwoodhouse -
- John Woodhouse -
-
- - jonasgeiler -
- Jonas Geiler -
-
- - KaitoKid -
- Kairui Zeng -
-
- - kaiserbh -
- KaiserBh -
-
- - maximuskowalski -
- Max Kowalski -
-
- - nmcc1212 -
- Nial -
-
- \ No newline at end of file