From 511d3a27f715587d19d31bd80bc2dec291ac589e Mon Sep 17 00:00:00 2001 From: kingchenc Date: Mon, 1 Jun 2026 18:19:23 +0200 Subject: [PATCH] ci: self-updating README banner + fix webpage count sync (#119) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * ci: fix webpage count sync crashing on removed public/hero.svg The webpage indicator-count sync sed'd index.md, .vitepress/config.ts and public/hero.svg, but hero.svg was removed from wickra-lib/webpage (the count is now baked into og-banner.webp at build time from index.md). Under 'bash -e' the missing file made sed exit 2 before the commit/push, so the count never reached the webpage repo and its OG banner stayed stale — masked green by the step's continue-on-error. Drops public/hero.svg from the sed and git add; index.md and .vitepress/config.ts (both still carry the count) remain. * docs: point README banner at the self-updating org profile image Switches the top README banner from https://wickra.org/og-banner.webp (baked at webpage deploy time) to the org profile banner that wickra-lib/.github's banner.yml regenerates from the indicator count on every sync (raw.githubusercontent.com/wickra-lib/.github/main/profile/wickra-banner.webp). The ?v=227 query busts GitHub's Camo image cache; the next commit teaches sync-about to bump it with the count. * ci: bump README banner cache-buster alongside the indicator count Extends the PR-head README counter patch to also rewrite wickra-banner.webp?v=N to the current count. The banner now points at the org profile image, whose content changes when .github/banner.yml regenerates it; bumping the ?v query busts GitHub's Camo cache so the README shows the new banner immediately. Rides in the existing count-sync commit, so no extra commit lands on main. * docs: changelog entry for self-updating README banner and sync fix --- .github/workflows/sync-about.yml | 10 +++++++--- CHANGELOG.md | 8 ++++++++ README.md | 2 +- 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/.github/workflows/sync-about.yml b/.github/workflows/sync-about.yml index 8b627ada..7c51a67f 100644 --- a/.github/workflows/sync-about.yml +++ b/.github/workflows/sync-about.yml @@ -10,7 +10,7 @@ name: Sync indicator count # 3. Docs site: index.md / overview.md / Indicators-Overview.md # (wickra-lib/wickra-docs) — synced on push to main / v* tag* # 4. Marketing site count (wickra-lib/webpage: index.md / -# .vitepress/config.ts / public/hero.svg) — push to main / v* tag* +# .vitepress/config.ts) — push to main / v* tag* # 5. org profile README count (wickra-lib/.github, profile/README.md) # — synced on push to main / v* tag* # 6. org description ("… N indicators, install-free.") @@ -165,6 +165,10 @@ jobs: run: | n="${{ steps.count.outputs.count }}" sed -i -E "s/[0-9]+ (streaming-first )?indicators/${n} \1indicators/g" README.md + # Bump the banner cache-buster so GitHub's Camo proxy refetches the org + # profile image (regenerated with the new count by .github/banner.yml) + # instead of serving a stale cached copy. + sed -i -E "s|(wickra-banner\.webp\?v=)[0-9]+|\1${n}|" README.md if git diff --quiet; then echo "No README changes after sed (counter regex did not match anything); skipping push." echo "changed=false" >> "$GITHUB_OUTPUT" @@ -424,14 +428,14 @@ jobs: exit 0 fi cd webpage-count - sed -i -E "s/[0-9]+ (streaming-first )?indicators/${n} \1indicators/g" index.md .vitepress/config.ts public/hero.svg + sed -i -E "s/[0-9]+ (streaming-first )?indicators/${n} \1indicators/g" index.md .vitepress/config.ts if git diff --quiet; then echo "Webpage indicator count unchanged." exit 0 fi git config user.name "wickra-bot" git config user.email "wickra-bot@users.noreply.github.com" - git add index.md .vitepress/config.ts public/hero.svg + git add index.md .vitepress/config.ts git commit -m "chore: sync indicator count to ${n}" if ! git push 2>/dev/null; then echo "::warning::push to wickra-lib/webpage failed — ABOUT_SYNC_TOKEN likely lacks write (findings P10.0a)." diff --git a/CHANGELOG.md b/CHANGELOG.md index a4b6433c..02e192a2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -43,6 +43,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 every candlestick pattern, making the family a drop-in machine-learning feature where bullish and bearish instances share a single dimension. +### Fixed +- **README banner now self-updates.** The top README banner points at the org + profile image that `.github/banner.yml` regenerates from the indicator count, + and `sync-about.yml` bumps a `?v=` cache-buster so GitHub's Camo proxy + refetches it immediately. Also fixes the webpage indicator-count sync, which + silently crashed on a removed `public/hero.svg` and left the marketing site's + count (and its OG banner) stale. + ### Security - **CI dependency installs are pinned by hash.** The Node binding now installs with `npm ci` (strict `package-lock.json`), and the Python CI/bench tooling is diff --git a/README.md b/README.md index 0cfe3918..2e0a5afe 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@

- Wickra — streaming-first technical indicators + Wickra — streaming-first technical indicators

[![CI](https://github.com/wickra-lib/wickra/actions/workflows/ci.yml/badge.svg)](https://github.com/wickra-lib/wickra/actions/workflows/ci.yml)