Skip to content

Commit

Permalink
chore: update contributors (#2824)
Browse files Browse the repository at this point in the history
  • Loading branch information
tasshi-me authored Jun 14, 2024
1 parent 29c8a8c commit 854f8ac
Show file tree
Hide file tree
Showing 4 changed files with 195 additions and 30 deletions.
13 changes: 5 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,8 @@ Cybozu, Inc.

## Contributors

- Isao Yoshikoshi [@latica-jp](https://github.com/latica-jp)
- Yohei Murayama [@mura-](https://github.com/mura-)
- Kosuke Kawachi [@kosuke-k](https://github.com/kosuke-k)
- Shohei Ihaya [@Climber22](https://github.com/Climber22)
- Yonashiro Yuu [@cloneko](https://github.com/cloneko)
- akira345 [@akira345](https://github.com/akira345)
- potaracom [@potaracom](https://github.com/potaracom)
- r3-yamauchi [@r3-yamauchi](https://github.com/r3-yamauchi)
<!-- credits-begin -->

[<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/1001444?v=4" alt="zaki-yama avatar" width="50" />](https://github.com/zaki-yama) [<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/33759872?v=4" alt="tasshi-me avatar" width="50" />](https://github.com/tasshi-me) [<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/26476?v=4" alt="teppeis avatar" width="50" />](https://github.com/teppeis) [<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/59815499?v=4" alt="hung-cybo avatar" width="50" />](https://github.com/hung-cybo) [<img src="https://avatars.githubusercontent.com/u/625124?v=4" alt="yokotaso avatar" width="50" />](https://github.com/yokotaso) [<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/12896448?v=4" alt="toshi-toma avatar" width="50" />](https://github.com/toshi-toma) [<img src="https://avatars.githubusercontent.com/u/15010907?v=4" alt="sakit0 avatar" width="50" />](https://github.com/sakit0) [<img src="https://avatars.githubusercontent.com/u/424903?v=4" alt="pirosikick avatar" width="50" />](https://github.com/pirosikick) [<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/24350169?v=4" alt="mmiyahara avatar" width="50" />](https://github.com/mmiyahara) [<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/46946976?v=4" alt="kjmnmt avatar" width="50" />](https://github.com/kjmnmt) [<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/534166?v=4" alt="ueokande avatar" width="50" />](https://github.com/ueokande) [<img src="https://avatars.githubusercontent.com/u/14838850?v=4" alt="sosukesuzuki avatar" width="50" />](https://github.com/sosukesuzuki) [<img src="https://avatars.githubusercontent.com/u/43398321?v=4" alt="niki-cy avatar" width="50" />](https://github.com/niki-cy) [<img src="https://avatars.githubusercontent.com/u/54124561?v=4" alt="potaracom avatar" width="50" />](https://github.com/potaracom) [<img src="https://avatars.githubusercontent.com/u/10701638?v=4" alt="will-yama avatar" width="50" />](https://github.com/will-yama) [<img src="https://avatars.githubusercontent.com/u/68312809?v=4" alt="minh-nguyen1985 avatar" width="50" />](https://github.com/minh-nguyen1985) [<img src="https://avatars.githubusercontent.com/u/25131938?v=4" alt="shohei-ihaya avatar" width="50" />](https://github.com/shohei-ihaya) [<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/23011709?v=4" alt="amishiratori avatar" width="50" />](https://github.com/amishiratori) [<img src="https://avatars.githubusercontent.com/u/655764?v=4" alt="akira345 avatar" width="50" />](https://github.com/akira345) [<img src="https://avatars.githubusercontent.com/u/7010971?v=4" alt="gorohash avatar" width="50" />](https://github.com/gorohash) [<img src="https://avatars.githubusercontent.com/u/19733683?v=4" alt="snyk-bot avatar" width="50" />](https://github.com/snyk-bot) [<img src="https://avatars.githubusercontent.com/u/19896354?v=4" alt="Kyome22 avatar" width="50" />](https://github.com/Kyome22) [<img src="https://avatars.githubusercontent.com/u/49222977?v=4" alt="jgdevroman avatar" width="50" />](https://github.com/jgdevroman) [<img src="https://avatars.githubusercontent.com/u/17062466?v=4" alt="cy-takeuchi avatar" width="50" />](https://github.com/cy-takeuchi) [<img src="https://avatars.githubusercontent.com/u/29246327?v=4" alt="kosuke-k avatar" width="50" />](https://github.com/kosuke-k) [<img src="https://avatars.githubusercontent.com/u/16587544?v=4" alt="latica-jp avatar" width="50" />](https://github.com/latica-jp) [<img src="https://avatars.githubusercontent.com/u/66581248?v=4" alt="shinsenman avatar" width="50" />](https://github.com/shinsenman) [<img src="https://avatars.githubusercontent.com/u/4494300?v=4" alt="the-red avatar" width="50" />](https://github.com/the-red) [<img src="https://avatars.githubusercontent.com/u/30137684?v=4" alt="r3-yamauchi avatar" width="50" />](https://github.com/r3-yamauchi) [<img src="https://avatars.githubusercontent.com/u/1659899?v=4" alt="mura- avatar" width="50" />](https://github.com/mura-) [<img src="https://avatars.githubusercontent.com/u/629915?v=4" alt="cloneko avatar" width="50" />](https://github.com/cloneko)

<!-- credits-end -->
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
"start": "pnpm build --watch",
"test": "pnpm test:root && pnpm -r --parallel run test",
"test:ci": "pnpm test:root && pnpm -r --stream run test:ci",
"test:e2e": "pnpm -r --parallel run test:e2e"
"test:e2e": "pnpm -r --parallel run test:e2e",
"update-contributors": "ts-node ./scripts/update-contributors.ts"
},
"repository": {
"type": "git",
Expand All @@ -39,6 +40,7 @@
"@babel/preset-typescript": "^7.24.7",
"@cybozu/eslint-config": "^23.0.0",
"@cybozu/license-manager": "^1.2.1",
"@octokit/rest": "^20.1.1",
"@types/jest": "^29.5.12",
"@types/node": "^18.19.34",
"babel-jest": "^29.7.0",
Expand All @@ -48,6 +50,7 @@
"npm-run-all": "^4.1.5",
"prettier": "^3.3.2",
"rimraf": "^5.0.7",
"ts-node": "^10.9.2",
"typescript": "^5.4.5"
},
"packageManager": "pnpm@8.15.8",
Expand Down
157 changes: 136 additions & 21 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: "js-sdk",
});

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 854f8ac

Please sign in to comment.