Files
.profile/.github/workflows/readme.yml
T
trex Bot ec787dc131
readme / refresh (push) Skipped
feat: render the terminal card as an SVG for GitHub
GitHub's markdown sanitizer strips style, class and inline <svg>, so the
coloured card cannot be inline HTML there. Build the card once as
(text, colour) segments and render it two ways: the existing <pre> with
coloured spans for Gitea, and a committed SVG behind <picture> for GitHub
(dark + light variants follow prefers-color-scheme).

--svg DIR writes terminal-{dark,light}.svg; --terminal-image swaps the
block for the <picture>. The Gitea workflow is unchanged.
2026-11-19 12:19:36 -06:00

73 lines
2.3 KiB
YAML

name: readme
# Regenerates the self-updating blocks in README.md on GitHub.
#
# The generator is not copied here: this job clones the public Gitea repo
# (git.jonb.io/jblu/.profile) and runs tools/gen_readme.py from there, so the
# code lives in exactly one place. Every data source is reached over its public
# FQDN, so nothing internal is needed:
#
# git.jonb.io Gitea API (anonymous is enough for the public repos)
# k.jonb.io Komodo
# todo.jonb.io Vikunja
# up.jonb.io Uptime Kuma
#
# Repo secrets, both optional - a missing one keeps the previous block text:
# KOMODO_API_KEY / KOMODO_API_SECRET
# VIKUNJA_TOKEN
#
# This same file also sits in the Gitea repo, where Gitea Actions would pick it
# up; the `github.repository` guard keeps it from running there.
#
# Cron is UTC: 10:00 UTC = 04:00 CST.
on:
schedule:
- cron: "0 10 * * *"
workflow_dispatch:
push:
branches: [main]
paths:
- ".github/workflows/readme.yml"
jobs:
refresh:
if: github.repository == 'jonbranan/jonbranan'
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Fetch generator from git.jonb.io
run: git clone --depth 1 https://git.jonb.io/jblu/.profile.git /tmp/src
- name: Regenerate
env:
KOMODO_API_KEY: ${{ secrets.KOMODO_API_KEY }}
KOMODO_API_SECRET: ${{ secrets.KOMODO_API_SECRET }}
VIKUNJA_TOKEN: ${{ secrets.VIKUNJA_TOKEN }}
run: |
# GitHub's sanitizer strips style/class/inline <svg>, so the coloured
# terminal card ships as a committed SVG behind <picture> instead of
# the inline <pre> Gitea gets.
python3 /tmp/src/tools/gen_readme.py --write --svg /tmp/svg --terminal-image
cp /tmp/src/README.md README.md
cp /tmp/svg/terminal-dark.svg /tmp/svg/terminal-light.svg .
- name: Check links are public
run: python3 /tmp/src/tools/gen_readme.py --check-links
- name: Commit
run: |
git config user.name trex
git config user.email nanobot@jonb.io
git add README.md terminal-dark.svg terminal-light.svg
if git diff --cached --quiet; then
echo "no change"
exit 0
fi
git commit -m "chore: refresh profile README"
git push