Skip to content

Commit 42c26fa

Browse files
authored
ci: add self-updating star history chart workflow (#206)
Adds narayann7/star-history-action on a daily schedule (plus `workflow_dispatch`) to render the repo's star-growth chart as light/dark SVGs into `assets/star-history/` and keep the new marker block at the bottom of `README.md` up to date. The action only commits when star data actually changed, and its commit message carries `[skip ci]`, so refreshes neither spam history nor trigger the CI workflow. Two deliberate deviations from the upstream example: the action is pinned to an immutable SHA instead of the mutable `v1` tag, since a third-party action holding `contents: write` that pushes to this repo shouldn't be silently updatable; and the per-star `watch` trigger is left out to avoid a commit for every star event — daily is enough. The first chart appears after a manual `workflow_dispatch` run once this lands on main; until then the marker block renders as empty. Localized READMEs under `docs/` are untouched for now — they can reference the same generated SVGs once the first run produces them. Signed-off-by: Kevin Cui <bh@bugs.cc>
1 parent 5bcd08d commit 42c26fa

2 files changed

Lines changed: 42 additions & 0 deletions

File tree

.github/workflows/star-history.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Star History
2+
3+
# Renders this repo's star-growth chart (light/dark SVG + PNG) into
4+
# assets/star-history/ and rewrites the marker block in README.md. The action
5+
# detects whether star data actually changed and only commits when it did, with
6+
# a "[skip ci]" commit message so chart refreshes don't trigger the CI workflow.
7+
# Daily schedule keeps commit noise low; use workflow_dispatch for an on-demand
8+
# refresh (e.g. the first run after merging this workflow).
9+
on:
10+
schedule:
11+
- cron: "0 3 * * *"
12+
workflow_dispatch:
13+
14+
# Serialize refreshes so a manual dispatch can't race the scheduled push.
15+
concurrency:
16+
group: star-history
17+
cancel-in-progress: true
18+
19+
# The action commits the refreshed chart and README and pushes to main.
20+
permissions:
21+
contents: write
22+
23+
jobs:
24+
star-history:
25+
name: Render & Commit Chart
26+
runs-on: ubuntu-latest
27+
steps:
28+
# Unlike ci.yml this checkout keeps persist-credentials on (the default):
29+
# the action's push step authenticates with the persisted GITHUB_TOKEN.
30+
- name: Checkout
31+
uses: actions/checkout@v7
32+
33+
# Pinned to an immutable SHA rather than the mutable v1 tag: this
34+
# third-party action holds contents:write and pushes to the repo, so its
35+
# supply chain must not be silently updatable.
36+
- name: Render and commit star history
37+
uses: narayann7/star-history-action@c2061675dacbf6f35d116e556015b8905843387f # v1.0.4

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -305,3 +305,8 @@ Thanks to everyone who has helped build OpenConnector. Want to join them? See
305305
[CONTRIBUTING.md](CONTRIBUTING.md).
306306

307307
[![OpenConnector contributors](https://contrib.rocks/image?repo=oomol-lab/open-connector)](https://github.com/oomol-lab/open-connector/graphs/contributors)
308+
309+
## Star History
310+
311+
<!-- star-history:start -->
312+
<!-- star-history:end -->

0 commit comments

Comments
 (0)