Public one-liner for opencode. Catalog is the filtered chat list from api.arka-ai.ru/v1/models, refreshed daily at 05:00 Europe/Moscow.
26 lines
776 B
Bash
Executable File
26 lines
776 B
Bash
Executable File
#!/usr/bin/env bash
|
|
# Daily catalog refresh for arka/public. Runs on core at 05:00 Europe/Moscow.
|
|
set -euo pipefail
|
|
|
|
ROOT="$(cd "$(dirname "$0")/.." && pwd)"
|
|
cd "$ROOT"
|
|
|
|
export GIT_SSH_COMMAND="${GIT_SSH_COMMAND:-ssh -i /root/.ssh/arka_public_catalog -o IdentitiesOnly=yes -o StrictHostKeyChecking=accept-new}"
|
|
|
|
git fetch origin main
|
|
git checkout -q main
|
|
git reset --hard origin/main
|
|
|
|
python3 scripts/sync-catalog.py
|
|
|
|
if git diff --quiet -- catalog.json; then
|
|
printf '%s no catalog change\n' "$(date -u +%Y-%m-%dT%H:%M:%SZ)"
|
|
exit 0
|
|
fi
|
|
|
|
git add catalog.json
|
|
git -c user.name='arka-catalog-bot' -c user.email='noreply@arka-ai.ru' \
|
|
commit -m "chore(catalog): refresh $(date -u +%Y-%m-%d)"
|
|
git push origin main
|
|
printf '%s catalog pushed\n' "$(date -u +%Y-%m-%dT%H:%M:%SZ)"
|