name: Sync Model Pricing on: schedule: # Run daily at 06:00 UTC - cron: '0 6 * * *' workflow_dispatch: # Allow manual trigger permissions: contents: write pull-requests: write jobs: sync-pricing: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v5 with: python-version: '3.12' - name: Sync pricing from OpenRouter API run: python scripts/sync-pricing.py --create-missing - name: Check for changes id: changes run: | git diff --quiet && echo "changed=false" >> "$GITHUB_OUTPUT" || echo "changed=true" >> "$GITHUB_OUTPUT" - name: Create PR if prices changed if: steps.changes.outputs.changed == 'true' uses: peter-evans/create-pull-request@v7 with: commit-message: "chore: sync model pricing from OpenRouter API" title: "chore: sync model pricing from OpenRouter API" body: | Automated pricing sync from [OpenRouter API](https://openrouter.ai/api/v1/models). Run by `sync-pricing.yml` cron job. branch: chore/auto-sync-pricing delete-branch: true