Skip to content

armgit / pibot

Public Imported from GitHub
0

Open-source, local-first AI agent team for your desktop: multi-agent group chats, computer use, browser, MCP, routines and approvals. macOS, Windows, Linux + Android. Built on pi.

Credit contributors in the English README

leen.zhoufc9ba2305b67
diff --git a/.github/workflows/readme-contributors.yml b/.github/workflows/readme-contributors.yml
new file mode 100644
index 0000000..81edd66
--- /dev/null
+++ b/.github/workflows/readme-contributors.yml
@@ -0,0 +1,45 @@
+name: README contributors
+
+on:
+ push:
+ branches: [main]
+ workflow_dispatch:
+
+permissions:
+ contents: read
+
+concurrency:
+ group: readme-contributors
+
+jobs:
+ refresh:
+ if: github.repository == 'w01fb0ss/PiBot' && github.ref == 'refs/heads/main'
+ runs-on: ubuntu-latest
+ timeout-minutes: 5
+ permissions:
+ contents: write
+ steps:
+ - uses: actions/checkout@v4
+ with:
+ ref: main
+ fetch-depth: 0
+ - uses: actions/setup-node@v4
+ with:
+ node-version-file: .nvmrc
+ - name: Refresh the English README
+ run: |
+ git config user.name 'github-actions[bot]'
+ git config user.email '41898282+github-actions[bot]@users.noreply.github.com'
+
+ for attempt in 1 2 3; do
+ if [ "$attempt" != 1 ]; then
+ git fetch origin main
+ git switch --detach FETCH_HEAD
+ fi
+ node tools/dev/update-readme-contributors.ts
+ if git diff --quiet -- README.md; then exit 0; fi
+ git add -- README.md
+ git commit --signoff -m 'docs: refresh contributor credits'
+ if git push origin HEAD:refs/heads/main; then exit 0; fi
+ done
+ exit 1
diff --git a/README.md b/README.md
index fe09283..9784837 100644
--- a/README.md
+++ b/README.md
@@ -104,6 +104,19 @@ Issues and pull requests are welcome. Please read [CONTRIBUTING.md](CONTRIBUTING
in [AGENTS.md](AGENTS.md) first; report security problems as described in
[SECURITY.md](SECURITY.md), not in public issues.
+## Contributors
+
+Thank you to everyone who has contributed to Pi Bot. See the
+[contribution activity](https://github.com/w01fb0ss/PiBot/graphs/contributors) on GitHub.
+
+<!-- CONTRIBUTORS:START -->
+- agooll
+- Ikko Eltociear Ashimine
+- JQuery
+- juemimgcd
+- leen.zhou
+<!-- CONTRIBUTORS:END -->
+
## Star History
<a href="https://www.star-history.com/#w01fb0ss/PiBot&Date">
diff --git a/tools/dev/update-readme-contributors.ts b/tools/dev/update-readme-contributors.ts
new file mode 100644
index 0000000..52bbe8b
--- /dev/null
+++ b/tools/dev/update-readme-contributors.ts
@@ -0,0 +1,45 @@
+import { execFileSync } from "node:child_process";
+import { readFileSync, writeFileSync } from "node:fs";
+
+const path = "README.md";
+const start = "<!-- CONTRIBUTORS:START -->\n";
+const end = "\n<!-- CONTRIBUTORS:END -->";
+const readme = readFileSync(path, "utf8");
+const from = readme.indexOf(start);
+const to = readme.indexOf(end);
+if (
+ from === -1 ||
+ from + start.length > to ||
+ from !== readme.lastIndexOf(start) ||
+ to !== readme.lastIndexOf(end)
+) {
+ throw new Error("Expected one contributor section in the English README");
+}
+
+// The mailmap canonicalizes aliases. Only names, never commit email addresses, go into the README.
+const authors = execFileSync(
+ "git",
+ ["log", "--no-merges", "--encoding=UTF-8", "--format=%aN", "HEAD"],
+ {
+ encoding: "utf8",
+ },
+);
+const names = [
+ ...new Set(
+ authors
+ .split("\n")
+ .map((name) => name.replace(/[\p{Cc}\p{Cf}]/gu, "").trim())
+ .filter((name) => name && !name.toLowerCase().endsWith("[bot]")),
+ ),
+].sort((left, right) => left.localeCompare(right, "en"));
+if (names.length === 0) throw new Error("No human commit authors found");
+
+// Encode Markdown and HTML syntax from the commit author field as text.
+const list = names
+ .map((name) => {
+ const label = name.replace(/[^\p{L}\p{M}\p{N} .-]/gu, (char) => `&#${char.codePointAt(0)};`);
+ return `- ${label}`;
+ })
+ .join("\n");
+const updated = readme.slice(0, from + start.length) + list + readme.slice(to);
+if (updated !== readme) writeFileSync(path, updated);