Skip to content

Publish catalog

Publish catalog #265

Workflow file for this run

name: Publish catalog
on:
schedule:
- cron: "23 */4 * * *"
workflow_dispatch:
permissions:
contents: write
concurrency:
group: publish-catalog
cancel-in-progress: false
jobs:
publish:
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- name: Checkout catalog
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Checkout openclaw
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
repository: openclaw/openclaw
path: openclaw
fetch-depth: 1
persist-credentials: false
- name: Setup Node
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
with:
node-version: "24.20.0"
- name: Install dependencies
working-directory: openclaw
run: |
corepack enable
pnpm install --frozen-lockfile
- name: Assemble catalog
working-directory: openclaw
run: node --import tsx scripts/publish-model-catalog.mts --pricing --out ../models/v1/catalog.next.json
- name: Commit on change only
run: |
set -euo pipefail
new=models/v1/catalog.next.json
cur=models/v1/catalog.json
# generatedAt/sourceCommit differ every run; only content changes count.
if [ -f "$cur" ] && [ "$(jq -S 'del(.generatedAt, .sourceCommit)' "$cur")" = "$(jq -S 'del(.generatedAt, .sourceCommit)' "$new")" ]; then
echo "catalog unchanged; skipping commit"
rm "$new"
exit 0
fi
mv "$new" "$cur"
git config user.name "openclaw-catalog[bot]"
git config user.email "catalog@openclaw.ai"
git add "$cur"
git commit -m "catalog: $(jq -r '"\(.providers | length) providers, \([.providers[].models | length] | add) models"' "$cur")"
git push