Skip to content

Commit 440d975

Browse files
author
Ahmed Mohamed
committed
Catalog refresh: commit directly to main instead of opening a PR
1 parent 24ae248 commit 440d975

1 file changed

Lines changed: 22 additions & 29 deletions

File tree

Lines changed: 22 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
11
name: catalog-refresh
22

3-
# Re-runs `tools/catalog/build_catalog.py` once a week and opens a PR if the
4-
# resulting `catalog/v1/models.json` has changed. The script discovers every
5-
# voice on the upstream sherpa-onnx TTS model index and computes a sha256 over
6-
# each release tarball — so when k2-fsa publishes new voices or rebuilds an
7-
# existing one, HayaiTTS sees it within a week without anyone touching the
8-
# repo by hand.
3+
# Re-runs `tools/catalog/build_catalog.py` once a week and commits the new
4+
# `catalog/v1/models.json` directly to main when it changes. The script
5+
# discovers every voice on the upstream sherpa-onnx TTS model index and
6+
# computes a sha256 over each release tarball — so when k2-fsa publishes new
7+
# voices or rebuilds an existing one, HayaiTTS sees it within a week without
8+
# anyone touching the repo by hand.
9+
#
10+
# We commit straight to main rather than opening a PR: the work is fully
11+
# deterministic, every voice change is captured in the workflow log, and
12+
# there's no human review value in approving 188 sha256 strings.
913

1014
on:
1115
schedule:
@@ -15,7 +19,6 @@ on:
1519

1620
permissions:
1721
contents: write
18-
pull-requests: write
1922

2023
jobs:
2124
refresh:
@@ -40,28 +43,18 @@ jobs:
4043
- name: Regenerate catalog
4144
run: python tools/catalog/build_catalog.py --output catalog/v1/models.json
4245

43-
- name: Check for changes
44-
id: diff
46+
- name: Commit + push if changed
4547
run: |
48+
set -euo pipefail
4649
if git diff --quiet --exit-code catalog/v1/models.json; then
47-
echo "changed=false" >> "$GITHUB_OUTPUT"
48-
else
49-
echo "changed=true" >> "$GITHUB_OUTPUT"
50+
echo "Catalog is identical to upstream — nothing to commit."
51+
exit 0
5052
fi
51-
52-
- name: Open pull request
53-
if: steps.diff.outputs.changed == 'true'
54-
uses: peter-evans/create-pull-request@v6
55-
with:
56-
commit-message: 'Refresh catalog from upstream sherpa-onnx index'
57-
title: 'Weekly catalog refresh'
58-
body: |
59-
Automated weekly run of `tools/catalog/build_catalog.py` against
60-
the upstream sherpa-onnx TTS model index produced a non-empty diff
61-
for `catalog/v1/models.json`. Review the changes — typically new
62-
voices appearing under existing families, or sha256 churn when
63-
upstream rebuilds a release tarball.
64-
branch: chore/catalog-refresh
65-
delete-branch: true
66-
base: main
67-
add-paths: catalog/v1/models.json
53+
git config user.name 'github-actions[bot]'
54+
git config user.email '41898282+github-actions[bot]@users.noreply.github.com'
55+
# Count voices for the commit message — a quick at-a-glance audit
56+
# of catalog churn from `git log catalog/v1/models.json`.
57+
count=$(python -c "import json; print(len(json.load(open('catalog/v1/models.json'))['voices']))")
58+
git add catalog/v1/models.json
59+
git commit -m "Refresh catalog from upstream sherpa-onnx index ($count voices)"
60+
git push origin HEAD:main

0 commit comments

Comments
 (0)