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 = `
@@ -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
-
-
-
-
\ No newline at end of file