-
-
Notifications
You must be signed in to change notification settings - Fork 0
Data Management
How GitHub Star Tracker stores, rotates, and manages tracking data.
All data lives on an orphan branch (default: star-tracker-data). This branch has its own Git history, completely separate from your main branch.
The branch name is configurable via data-branch:
with:
data-branch: 'my-star-data'The working directory for the branch is derived from the name: .${dataBranch} (e.g. .star-tracker-data/).
| File | Description | When Created |
|---|---|---|
README.md |
Markdown report with embedded charts | Every run |
stars-data.json |
Historical snapshot data | Every run |
stars-badge.svg |
Star count badge | Every run |
charts/star-history.svg |
Total stars chart | After 2+ runs |
charts/comparison.svg |
Top repos comparison | After 2+ runs |
charts/forecast.svg |
Growth forecast | After 3+ runs |
charts/{owner}-{repo}.svg |
Per-repo charts | After 2+ runs |
stargazers.json |
Stargazer login map | Only with track-stargazers: true
|
Each run creates a snapshot appended to the snapshots array in stars-data.json:
{
"snapshots": [
{
"timestamp": "2026-02-15T00:00:00.000Z",
"totalStars": 523,
"repos": [
{
"fullName": "user/repo-a",
"name": "repo-a",
"owner": "user",
"stars": 300
},
{
"fullName": "user/repo-b",
"name": "repo-b",
"owner": "user",
"stars": 223
}
]
}
],
"starsAtLastNotification": 520
}-
timestamp— ISO 8601 datetime of when the run occurred -
totalStars— sum of all tracked repos' stars -
repos[]— per-repo data (fullName, name, owner, stars) -
starsAtLastNotification— used by the notification threshold system; updated only when a notification is sent
The max-history setting (default: 52) controls how many snapshots are retained. When the limit is exceeded, the oldest snapshots are pruned.
| Schedule |
max-history: 52 covers |
max-history: 104 covers |
|---|---|---|
| Daily | ~7 weeks | ~15 weeks |
| Weekly | ~1 year | ~2 years |
| Monthly | ~4 years | ~8 years |
with:
max-history: '104' # Keep more historyPruning is a pure domain function (addSnapshot() in src/domain/snapshot.ts). It returns a new History object with the snapshot appended and old entries trimmed — no mutation, no side effects.
The infrastructure layer (writeHistory()) only handles serialization to disk.
When track-stargazers: true, the action maintains a separate stargazers.json file:
{
"user/repo-a": ["octocat", "defunkt"],
"user/repo-b": ["octocat"]
}This stores only login names (not avatars or dates) for efficient diffing between runs. Full stargazer details (avatar, profile URL, starred date) are only shown in reports.
On the first run:
- The action creates the data branch as an orphan branch
- An initial empty commit is made
- All repos are recorded with
delta: 0(no previous data to compare against) - No charts are generated (need 2+ data points)
- No forecasts are generated (need 3+ data points)
If no star counts change between runs, the action detects this via git diff --cached --quiet and skips the commit. No empty commits are created.
The data branch uses Git worktrees for isolation:
-
Primary worktree: your main repo checkout (
GITHUB_WORKSPACE) -
Secondary worktree: created at
.${dataBranch}/pointing to the data branch - Same
.gitdirectory but independent working trees - Worktree is created at the start and removed in a
finallyblock
This means the action never runs git checkout on your main branch, avoiding disruption.
Delete the data branch to start fresh:
git push origin --delete star-tracker-dataThe next workflow run will recreate it.
git clone -b star-tracker-data --single-branch \
https://github.com/YOUR_USER/YOUR_REPO.git star-datacurl -s https://raw.githubusercontent.com/YOUR_USER/YOUR_REPO/star-tracker-data/stars-data.json | jq .| Repos Tracked | Approximate Size per Snapshot |
|---|---|
| 10 | ~1 KB |
| 50 | ~4 KB |
| 100 | ~8 KB |
| 500 | ~40 KB |
With max-history: 52 and 100 repos, stars-data.json stays under ~500 KB.
- Viewing Reports — How to access your data
-
Configuration —
data-branchandmax-historyoptions - How It Works — Full execution pipeline