diff --git a/.github/scripts/update-contributors.js b/.github/scripts/update-contributors.js index 75e6f2881..97647e680 100644 --- a/.github/scripts/update-contributors.js +++ b/.github/scripts/update-contributors.js @@ -13,6 +13,7 @@ } let contributors = '\n\n'; + let count = 0; response.data.forEach((user, index) => { if (!user.login || !user.html_url || !user.avatar_url) { @@ -31,9 +32,17 @@ // Add a new row every 6th user if ((index + 1) % 6 === 0) { contributors += '\n\n\n'; + count = 0; + } else { + count++; } }); + // Add empty cells if there are fewer than 6 contributors in the last row + for (let i = count; i < 6; i++) { + contributors += ''; + } + contributors += '\n
'; fs.writeFileSync('CONTRIBUTORS.md', `## Contributors\n\n\n${contributors}\n\n`);