Skip to content

Commit 1e4c909

Browse files
mcvalosborneclaude
andcommitted
Add weekly theme-key sync check + README note
Adds a GitHub Actions workflow (Mondays 09:00 UTC, plus manual trigger) that compares the mixer's theme keys against the upstream Ghostty theme list (iTerm2-Color-Schemes/ghostty). If any mixer key no longer matches an upstream filename, it opens — or updates — a single 'theme-drift' issue so it gets fixed before users hit the error dialog. README updated to describe the new copy-command flow and the sync guarantee. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 0bd78d9 commit 1e4c909

2 files changed

Lines changed: 109 additions & 3 deletions

File tree

.github/workflows/check-themes.yml

Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
name: Check theme keys
2+
3+
on:
4+
schedule:
5+
- cron: "0 9 * * 1"
6+
workflow_dispatch:
7+
8+
permissions:
9+
contents: read
10+
issues: write
11+
12+
jobs:
13+
check:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v4
17+
18+
- name: Fetch upstream Ghostty theme filenames
19+
env:
20+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
21+
run: |
22+
curl -s -H "Authorization: Bearer $GH_TOKEN" \
23+
"https://api.github.com/repos/mbadolato/iTerm2-Color-Schemes/contents/ghostty" \
24+
| jq -r '.[].name' | sort > upstream.txt
25+
count=$(wc -l < upstream.txt)
26+
if [ "$count" -lt 100 ]; then
27+
echo "Upstream fetch returned only $count themes — aborting."
28+
exit 1
29+
fi
30+
echo "Fetched $count upstream themes."
31+
32+
- name: Extract mixer theme keys
33+
run: |
34+
awk '/const themes = \[/,/^ \];/' index.html \
35+
| grep -oE 'key: "[^"]+"' \
36+
| sed -E 's/key: "(.+)"/\1/' \
37+
| sort -u > mixer.txt
38+
echo "Found $(wc -l < mixer.txt) keys in mixer:"
39+
cat mixer.txt
40+
41+
- name: Compare
42+
id: diff
43+
run: |
44+
missing=$(comm -23 mixer.txt upstream.txt)
45+
if [ -n "$missing" ]; then
46+
echo "=== DRIFT DETECTED ==="
47+
echo "$missing"
48+
{
49+
echo "missing<<EOF"
50+
echo "$missing"
51+
echo "EOF"
52+
} >> "$GITHUB_OUTPUT"
53+
else
54+
echo "All mixer keys match upstream."
55+
fi
56+
57+
- name: Open or update issue
58+
if: steps.diff.outputs.missing != ''
59+
uses: actions/github-script@v7
60+
with:
61+
script: |
62+
const missing = process.env.MISSING.trim();
63+
const body = [
64+
"The weekly theme-drift check found `key` values in `index.html` that no longer match any file in Ghostty's upstream themes (sourced from [iTerm2-Color-Schemes/ghostty](https://github.com/mbadolato/iTerm2-Color-Schemes/tree/master/ghostty)).",
65+
"",
66+
"**Keys that no longer resolve:**",
67+
"```",
68+
missing,
69+
"```",
70+
"",
71+
"Fix: update the `key` values in the `themes` array in `index.html` so each matches an existing filename upstream.",
72+
"",
73+
"Verify locally: `ls /Applications/Ghostty.app/Contents/Resources/ghostty/themes/`",
74+
].join("\n");
75+
76+
const { data: existing } = await github.rest.issues.listForRepo({
77+
owner: context.repo.owner,
78+
repo: context.repo.repo,
79+
state: 'open',
80+
labels: 'theme-drift',
81+
});
82+
83+
if (existing.length > 0) {
84+
await github.rest.issues.createComment({
85+
owner: context.repo.owner,
86+
repo: context.repo.repo,
87+
issue_number: existing[0].number,
88+
body,
89+
});
90+
core.info(`Commented on existing issue #${existing[0].number}`);
91+
} else {
92+
const { data: issue } = await github.rest.issues.create({
93+
owner: context.repo.owner,
94+
repo: context.repo.repo,
95+
title: 'Theme keys out of sync with Ghostty upstream',
96+
body,
97+
labels: ['theme-drift'],
98+
});
99+
core.info(`Opened issue #${issue.number}`);
100+
}
101+
env:
102+
MISSING: ${{ steps.diff.outputs.missing }}

README.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,16 @@ Live theme & font mixer for the [Ghostty](https://ghostty.org) terminal. Preview
1616
## Apply your mix
1717

1818
1. Pick theme + font + tint in the mixer
19-
2. Click **Copy config**
20-
3. Paste into `~/.config/ghostty/config`
21-
4. Reload with `⌘ ⇧ ,` in Ghostty — change is instant, no restart
19+
2. Click **Copy command**
20+
3. Paste the command into any terminal (Ghostty included) and hit enter — it appends to `~/.config/ghostty/config`
21+
4. Reload Ghostty with `⌘ ⇧ ,` — change is instant, no restart
2222

2323
If a theme name isn't recognised by your Ghostty version, run `ghostty +list-themes | grep -i <name>` to find the exact spelling.
2424

25+
## Kept in sync with Ghostty
26+
27+
Theme keys in the mixer are verified **weekly** against [iTerm2-Color-Schemes/ghostty](https://github.com/mbadolato/iTerm2-Color-Schemes/tree/master/ghostty) — the upstream source Ghostty bundles its themes from. If a theme is ever renamed or removed upstream, a GitHub issue is opened automatically (see [`.github/workflows/check-themes.yml`](.github/workflows/check-themes.yml)) so the mixer stays in lockstep with whatever you have installed.
28+
2529
## Local development
2630

2731
It's a single static HTML file — no build step.

0 commit comments

Comments
 (0)