From 769a9ca6e1d8736da14cb1df71b98f66d22a373e Mon Sep 17 00:00:00 2001 From: kobenguyent Date: Tue, 17 Dec 2024 17:04:46 +0100 Subject: [PATCH 1/2] fix: all contributors --- .all-contributorsrc | 14 ++++++++++++++ README.md | 42 +++++++++++------------------------------- 2 files changed, 25 insertions(+), 31 deletions(-) create mode 100644 .all-contributorsrc diff --git a/.all-contributorsrc b/.all-contributorsrc new file mode 100644 index 000000000..4d81b94b7 --- /dev/null +++ b/.all-contributorsrc @@ -0,0 +1,14 @@ +{ + "projectName": "CodeceptJS", + "projectOwner": "codeceptjs", + "repoType": "github", + "repoHost": "https://github.com", + "files": ["README.md"], + "imageSize": 100, + "commit": true, + "commitConvention": "eslint", + "contributors": [], + "contributorsPerLine": 7, + "linkToUsage": true +} + diff --git a/README.md b/README.md index 184193331..8550e61b0 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,7 @@ [![Stand With Ukraine](https://raw.githubusercontent.com/vshymanskyy/StandWithUkraine/main/banner-direct-single.svg)](https://stand-with-ukraine.pp.ua) + +[![All Contributors](https://img.shields.io/badge/all_contributors-0-orange.svg?style=flat-square)](#contributors-) + @@ -293,38 +296,15 @@ When using Typescript, replace `module.exports` with `export` for autocompletion ## Contributors Thanks all to those who are and will have contributing to this awesome project! + + + + + + + + -[//]: contributor-faces - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -[//]: contributor-faces ## License From c4d5caac3ce09ac6e7a3057e826cb2419573e022 Mon Sep 17 00:00:00 2001 From: kobenguyent Date: Tue, 17 Dec 2024 17:34:42 +0100 Subject: [PATCH 2/2] fix: all contributors --- .all-contributorsrc | 14 -- README.md | 336 ++++++++++++++++++++++++++++++++++++++++---- package.json | 1 - runok.js | 73 ++++++++-- 4 files changed, 375 insertions(+), 49 deletions(-) delete mode 100644 .all-contributorsrc diff --git a/.all-contributorsrc b/.all-contributorsrc deleted file mode 100644 index 4d81b94b7..000000000 --- a/.all-contributorsrc +++ /dev/null @@ -1,14 +0,0 @@ -{ - "projectName": "CodeceptJS", - "projectOwner": "codeceptjs", - "repoType": "github", - "repoHost": "https://github.com", - "files": ["README.md"], - "imageSize": 100, - "commit": true, - "commitConvention": "eslint", - "contributors": [], - "contributorsPerLine": 7, - "linkToUsage": true -} - diff --git a/README.md b/README.md index 8550e61b0..8708ace10 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,5 @@ [![Stand With Ukraine](https://raw.githubusercontent.com/vshymanskyy/StandWithUkraine/main/banner-direct-single.svg)](https://stand-with-ukraine.pp.ua) - -[![All Contributors](https://img.shields.io/badge/all_contributors-0-orange.svg?style=flat-square)](#contributors-) - + @@ -295,26 +293,316 @@ When using Typescript, replace `module.exports` with `export` for autocompletion ## Contributors -Thanks all to those who are and will have contributing to this awesome project! - - - - - - - - - - -## License -MIT © [CodeceptJS Team](http://codecept.io) -[npm-image]: https://badge.fury.io/js/codeceptjs.svg -[npm-url]: https://npmjs.org/package/codeceptjs -[travis-image]: https://travis-ci.org/Codeception/codeceptjs.svg?branch=master -[travis-url]: https://travis-ci.org/Codeception/codeceptjs -[daviddm-image]: https://david-dm.org/Codeception/codeceptjs.svg?theme=shields.io -[daviddm-url]: https://david-dm.org/Codeception/codeceptjs -[coveralls-image]: https://coveralls.io/repos/Codeception/codeceptjs/badge.svg -[coveralls-url]: https://coveralls.io/r/Codeception/codeceptjs +
+ +
+ + DavertMik + +
+ + DavertMik + +
+ + +
+ + kobenguyent + +
+ + kobenguyent + +
+ + +
+ + Vorobeyko + +
+ + Vorobeyko + +
+ + +
+ + reubenmiller + +
+ + reubenmiller + +
+ + +
+ + Arhell + +
+ + Arhell + +
+ + +
+ + APshenkin + +
+ + APshenkin + +
+ + +
+ + fabioel + +
+ + fabioel + +
+ + +
+ + pablopaul + +
+ + pablopaul + +
+ + +
+ + mirao + +
+ + mirao + +
+ + +
+ + Georgegriff + +
+ + Georgegriff + +
+ + +
+ + KMKoushik + +
+ + KMKoushik + +
+ + +
+ + nikocanvacom + +
+ + nikocanvacom + +
+ + +
+ + elukoyanov + +
+ + elukoyanov + +
+ + +
+ + gkushang + +
+ + gkushang + +
+ + +
+ + thomashohn + +
+ + thomashohn + +
+ + +
+ + tsuemura + +
+ + tsuemura + +
+ + +
+ + EgorBodnar + +
+ + EgorBodnar + +
+ + +
+ + VikalpP + +
+ + VikalpP + +
+ + +
+ + elaichenkov + +
+ + elaichenkov + +
+ + +
+ + BorisOsipov + +
+ + BorisOsipov + +
+ + +
+ + ngraf + +
+ + ngraf + +
+ + +
+ + nitschSB + +
+ + nitschSB + +
+ + +
+ + hubidu + +
+ + hubidu + +
+ + +
+ + jploskonka + +
+ + jploskonka + +
+ + +
+ + maojunxyz + +
+ + maojunxyz + +
+ + +
+ + abhimanyupandian + +
+ + abhimanyupandian + +
+ + +
+ + martomo + +
+ + martomo + +
+ + +
+ + hatufacci + +
+ + hatufacci + +
+ +
+ diff --git a/package.json b/package.json index 84d2cf82b..e7b35bfdc 100644 --- a/package.json +++ b/package.json @@ -135,7 +135,6 @@ "apollo-server-express": "3.13.0", "chai-as-promised": "7.1.2", "chai-subset": "1.6.0", - "contributor-faces": "1.1.0", "documentation": "14.0.3", "electron": "33.2.1", "eslint": "9.17.0", diff --git a/runok.js b/runok.js index ca24886f6..2b034459c 100755 --- a/runok.js +++ b/runok.js @@ -9,7 +9,6 @@ const { tasks: { git, copy, exec, replaceInFile, npmRun, npx, writeToFile }, runok, } = require('runok') -const contributors = require('contributor-faces') const { execSync } = require('node:child_process') const semver = require('semver') @@ -474,15 +473,69 @@ ${changelog}` async contributorFaces() { // update contributors list in readme - await contributors.update(null, { exclude: 'actions-user' }) - let readmeContent = fs.readFileSync('README.md') - readmeContent = readmeContent - .toString() - .replace( - '\n', - '', - ) - fs.writeFileSync('./README.md', readmeContent) + const owner = 'codeceptjs' + const repo = 'codeceptjs' + const token = process.env.GH_TOKEN + + try { + const response = await axios.get( + `https://api.github.com/repos/${owner}/${repo}/contributors`, + { + headers: { Authorization: `token ${token}` }, + }, + ); + + // Filter out bot accounts + const filteredContributors = response.data.filter( + (contributor) => !contributor.login.includes('dependabot'), + ).filter( + (contributor) => !contributor.login.includes('actions-user'), + ); + + const contributors = filteredContributors.map((contributor) => { + return ` +
+ + ${contributor.login} + +
+ + ${contributor.login} + +
+ `; + }); + + // Wrap contributors in a grid container + const contributorsGrid = ` +
+ ${contributors.join('\n')} +
+ `; + + const readmePath = path.join(__dirname, 'README.md'); + let content = fs.readFileSync(readmePath, 'utf-8'); + + // Replace or add the contributors section in the README + const contributorsSectionRegex = /(## Contributors\s*\n)([\s\S]*?)(\n##|$)/; + const match = content.match(contributorsSectionRegex); + + if (match) { + const updatedContent = content.replace( + contributorsSectionRegex, + `${match[1]}\n${contributorsGrid}\n${match[3]}`, + ); + fs.writeFileSync(readmePath, updatedContent, 'utf-8'); + } else { + // If no contributors section exists, add one at the end + content += `\n${contributorsGrid}`; + fs.writeFileSync(readmePath, content, 'utf-8'); + } + + console.log('Contributors section updated successfully!'); + } catch (error) { + console.error('Error fetching contributors:', error.message); + } }, getCurrentBetaVersion() {