Skip to content

Commit

Permalink
chore: add contributors on README (#786)
Browse files Browse the repository at this point in the history
  • Loading branch information
tasshi-me committed Jun 14, 2024
1 parent 2321e22 commit ac07129
Show file tree
Hide file tree
Showing 4 changed files with 189 additions and 7 deletions.
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -451,3 +451,15 @@ Steps:
## LICENSE

- [MIT](https://github.com/kintone/cli-kintone/blob/main/LICENSE)

## Author

Cybozu, Inc.

## Contributors

<!-- credits-begin -->

[<img src="https://avatars.githubusercontent.com/u/33759872?v=4" alt="tasshi-me avatar" width="50" />](https://github.com/tasshi-me) [<img src="https://avatars.githubusercontent.com/u/59815499?v=4" alt="hung-cybo avatar" width="50" />](https://github.com/hung-cybo) [<img src="https://avatars.githubusercontent.com/u/41720778?v=4" alt="tuanphamcybozu avatar" width="50" />](https://github.com/tuanphamcybozu) [<img src="https://avatars.githubusercontent.com/u/14119304?v=4" alt="chick-p avatar" width="50" />](https://github.com/chick-p) [<img src="https://avatars.githubusercontent.com/u/9845816?v=4" alt="shisama avatar" width="50" />](https://github.com/shisama) [<img src="https://avatars.githubusercontent.com/u/1001444?v=4" alt="zaki-yama avatar" width="50" />](https://github.com/zaki-yama) [<img src="https://avatars.githubusercontent.com/u/250407?v=4" alt="koba04 avatar" width="50" />](https://github.com/koba04) [<img src="https://avatars.githubusercontent.com/u/22951237?v=4" alt="b4h0-c4t avatar" width="50" />](https://github.com/b4h0-c4t) [<img src="https://avatars.githubusercontent.com/u/1995370?v=4" alt="nakajmg avatar" width="50" />](https://github.com/nakajmg) [<img src="https://avatars.githubusercontent.com/u/48338353?v=4" alt="shintaroNagata avatar" width="50" />](https://github.com/shintaroNagata) [<img src="https://avatars.githubusercontent.com/u/46946976?v=4" alt="kjmnmt avatar" width="50" />](https://github.com/kjmnmt) [<img src="https://avatars.githubusercontent.com/u/534166?v=4" alt="ueokande avatar" width="50" />](https://github.com/ueokande) [<img src="https://avatars.githubusercontent.com/u/62086225?v=4" alt="ksm-cy avatar" width="50" />](https://github.com/ksm-cy) [<img src="https://avatars.githubusercontent.com/u/62008782?v=4" alt="ryounasso avatar" width="50" />](https://github.com/ryounasso) [<img src="https://avatars.githubusercontent.com/u/117426935?v=4" alt="jesslynvc avatar" width="50" />](https://github.com/jesslynvc) [<img src="https://avatars.githubusercontent.com/u/30670749?v=4" alt="ahandsel avatar" width="50" />](https://github.com/ahandsel)

<!-- credits-end -->
16 changes: 9 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@
"clean": "rimraf lib bin artifacts dist",
"clean:test": "rimraf allure-results allure-report",
"doc:start": "pnpm --filter ./website start",
"doc:build": "pnpm --filter ./website build"
"doc:build": "pnpm --filter ./website build",
"update-contributors": "ts-node ./scripts/update-contributors.ts"
},
"repository": {
"type": "git",
Expand Down Expand Up @@ -68,28 +69,29 @@
"@cucumber/cucumber": "^10.8.0",
"@cybozu/eslint-config": "^23.0.0",
"@cybozu/license-manager": "^1.2.1",
"@octokit/rest": "^20.1.1",
"@types/inquirer": "^8.2.10",
"@types/jest": "^29.5.12",
"@types/node": "^18.19.34",
"@types/rollup-plugin-auto-external": "^2.0.5",
"@types/yargs": "^17.0.32",
"@vercel/ncc": "^0.38.1",
"ajv": "^8.16.0",
"allure-commandline": "^2.29.0",
"allure-cucumberjs": "^2.15.1",
"allure-jest": "^2.15.1",
"babel-jest": "^29.7.0",
"cross-env": "^7.0.3",
"eslint": "^8.57.0",
"glob": "^10.4.1",
"jest": "^29.7.0",
"npm-run-all": "^4.1.5",
"pkg": "^5.8.1",
"prettier": "^3.3.2",
"rimraf": "^5.0.7",
"ts-node": "^10.9.2",
"typescript": "^5.4.5",
"zx": "^8.1.2",
"ajv": "^8.16.0",
"allure-commandline": "^2.29.0",
"allure-cucumberjs": "^2.15.1",
"allure-jest": "^2.15.1",
"glob": "^10.4.1"
"zx": "^8.1.2"
},
"dependencies": {
"@kintone/rest-api-client": "^5.5.2",
Expand Down
118 changes: 118 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

50 changes: 50 additions & 0 deletions scripts/update-contributors.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
// eslint-disable-next-line node/no-unpublished-import
import { Octokit } from "@octokit/rest";
import * as fs from "fs/promises";

const ignoredUsers = [
"renovate[bot]",
"github-actions[bot]",
"trigger-github-actions-release[bot]",
"renovate-bot",
];

const file = "README.md";

(async () => {
const octokit = new Octokit();

// We use stats because the response of octokit.repos.listContributors is missing some contributors.
const resp = await octokit.repos.getContributorsStats({
owner: "kintone",
repo: "cli-kintone",
});

const contributors = resp.data
.filter(
(c) =>
c.author?.type === "User" && !ignoredUsers.includes(c.author.login),
)
.sort((c1, c2) => c2.total - c1.total)
.map((c) => ({
login: c.author?.login,
avatar_url: c.author?.avatar_url,
html_url: c.author?.html_url,
}));

const contributorIcons = contributors
.map(
(contributor) =>
`[<img src="${contributor.avatar_url}" alt="${contributor.login} avatar" width="50" />](${contributor.html_url})`,
)
.join(" ");
const newCredits = `<!-- credits-begin -->\n\n${contributorIcons}\n\n<!-- credits-end -->`;

const content = await fs.readFile(file, { encoding: "utf-8" });
const newContent = content.replace(
/<!-- credits-begin -->.+<!-- credits-end -->/gs,
newCredits,
);

await fs.writeFile(file, newContent);
})();

0 comments on commit ac07129

Please sign in to comment.