Skip to content

Commit 024c081

Browse files
pirateclaude
andcommitted
CI: regenerate homepage user list from deployed dashboards
The index.html had a hardcoded <ul> that fell out of sync as FiloSottile/nsnx/etc. were added via self-serve. Now a step runs before the final deploy: enumerates cloudflare/public/*.html (excluding index/404), sorts case-insensitively, and rewrites the <ul> so the homepage matches reality. Also updates the footer to mention the self-serve flow instead of the old "open a PR on users.txt" instructions. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 0d9c4a7 commit 024c081

1 file changed

Lines changed: 37 additions & 0 deletions

File tree

.github/workflows/mine-and-deploy.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,43 @@ jobs:
215215
git diff --staged --quiet || git commit -m "Add ${{ inputs.user }} to users.txt [skip ci]"
216216
git push || echo "::warning::push failed (no commit permission?)"
217217
218+
# Rebuild the homepage user list from the set of dashboards we
219+
# are actually about to deploy, so /<login> entries match reality
220+
# (and users added via the self-serve flow show up automatically).
221+
- name: Regenerate user index
222+
run: |
223+
python3 <<'PY'
224+
from pathlib import Path
225+
import re
226+
pub = Path("cloudflare/public")
227+
users = sorted(
228+
(p.stem for p in pub.glob("*.html")
229+
if p.stem not in {"index", "404"}),
230+
key=str.lower,
231+
)
232+
rows = []
233+
for u in users:
234+
if u == "pirate":
235+
rows.append(f' <li><a href="/{u}">/{u}</a> — Nick Sweeting (enhanced)</li>')
236+
else:
237+
rows.append(f' <li><a href="/{u}">/{u}</a></li>')
238+
html = (pub / "index.html").read_text()
239+
html = re.sub(
240+
r"<ul>.*?</ul>",
241+
"<ul>\n" + "\n".join(rows) + "\n </ul>",
242+
html,
243+
count=1,
244+
flags=re.S,
245+
)
246+
# Update the "open a PR" footer to mention the self-serve flow.
247+
html = html.replace(
248+
'Want to add yourself? <a href="https://github.com/ArchiveBox/githubusers/edit/main/cloudflare/users.txt">Open a PR on users.txt</a>.',
249+
'Want your dashboard here? Just visit <code>/&lt;your-login&gt;</code> — mining kicks off automatically.',
250+
)
251+
(pub / "index.html").write_text(html)
252+
print(f"Wrote index.html with {len(users)} users: {users}")
253+
PY
254+
218255
- name: Final deploy
219256
working-directory: cloudflare
220257
run: npx --yes wrangler@latest deploy

0 commit comments

Comments
 (0)