From acc4a41f218b8528516a3ae04a736e7bfb433949 Mon Sep 17 00:00:00 2001 From: leecoder Date: Tue, 8 Sep 2026 12:22:01 +0900 Subject: [PATCH] ci(workflow): run monitor on the fork and open PRs against upstream The monitor now executes on the leecoder/litellm fork: - checkout pins the upstream repo and its litellm_internal_staging base, so the monitor always audits upstream's registry, not the fork's - schedule guard skips upstream's own checkout (only the fork runs it); manual workflow_dispatch still works on upstream - changed rates push to a dated branch on the fork and open the PR against BerriAI/litellm with head leecoder: - PR identity: leecoder / leecoder@aol.com - auth uses the DBX_MONITOR_TOKEN secret (leecoder PAT with repo scopes); the default GITHUB_TOKEN cannot create PRs across forks - permissions trimmed to contents: write --- .../workflows/monitor_databricks_pricing.yml | 36 +++++++++++++------ 1 file changed, 25 insertions(+), 11 deletions(-) diff --git a/.github/workflows/monitor_databricks_pricing.yml b/.github/workflows/monitor_databricks_pricing.yml index 0aefd778b40..3b2c19da76b 100644 --- a/.github/workflows/monitor_databricks_pricing.yml +++ b/.github/workflows/monitor_databricks_pricing.yml @@ -1,5 +1,8 @@ name: Monitor Databricks Pricing +# Runs on the leecoder/litellm fork on a daily schedule. When the official +# Databricks pricing pages drift from the registry, the monitor opens a PR +# against the upstream repo (BerriAI/litellm) from a fork branch. on: schedule: - cron: "0 2 * * *" # daily 02:00 UTC @@ -7,16 +10,25 @@ on: permissions: contents: write - pull-requests: write + +env: + FORK_REPO: leecoder/litellm + UPSTREAM_REPO: BerriAI/litellm + UPSTREAM_BASE: litellm_internal_staging jobs: monitor-db-pricing: + # Upstream runs the same checkout on schedule; skip there so only the + # fork drives the monitor. Manual dispatch still works on upstream. + if: github.repository == 'leecoder/litellm' || github.event_name == 'workflow_dispatch' runs-on: ubuntu-latest steps: - uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0 with: persist-credentials: false fetch-depth: 0 + repository: ${{ env.UPSTREAM_REPO }} + ref: ${{ env.UPSTREAM_BASE }} - name: Set up Python uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5.4.0 @@ -24,6 +36,7 @@ jobs: python-version: "3.12" - name: Run monitor + id: monitor shell: bash run: | set -o pipefail @@ -34,27 +47,28 @@ jobs: echo "changed=true" >> "$GITHUB_OUTPUT" fi - - name: Open PR if changed + - name: Open PR on upstream if changed if: steps.monitor.outputs.changed == 'true' env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - GITHUB_TOKEN_FOR_PUSH: ${{ secrets.GITHUB_TOKEN }} + GH_TOKEN: ${{ secrets.DBX_MONITOR_TOKEN }} # leecoder PAT with repo + workflow scopes + GITHUB_TOKEN_FOR_PUSH: ${{ secrets.DBX_MONITOR_TOKEN }} run: | BRANCH="monitor-dbx-pricing-$(date +'%Y-%m-%d')" - git config user.name "github-actions[bot]" - git config user.email "41898282+github-actions[bot]@users.noreply.github.com" + git config user.name "leecoder" + git config user.email "leecoder@aol.com" git checkout -b "$BRANCH" git add model_prices_and_context_window.json litellm/model_prices_and_context_window_backup.json git commit -m "chore(model_prices): refresh Databricks Foundation Model Serving rates - automated monitor detected changed DBU rates on the Databricks pricing pages; refreshed the mapped databricks/* entries." - git push "https://x-access-token:${GITHUB_TOKEN_FOR_PUSH}@github.com/${GITHUB_REPOSITORY}.git" "$BRANCH" + git remote add fork "https://x-access-token:${GITHUB_TOKEN_FOR_PUSH}@github.com/${FORK_REPO}.git" + git push fork "HEAD:refs/heads/$BRANCH" { cat /tmp/dbx_monitor_pr_body.md echo echo "---" - echo "Auto-generated by the Databricks pricing monitor. \`PROMO_SKIPPED\`/\`REVIEW\`/\`MISSING_FROM_PAGE\` lines need human attention; \`UPDATED\` lines were applied automatically." + echo "Auto-generated by the Databricks pricing monitor running on the ${FORK_REPO} fork. \`PROMO_SKIPPED\`/\`REVIEW\`/\`MISSING_FROM_PAGE\` lines need human attention; \`UPDATED\` lines were applied automatically." } > /tmp/dbx_pr_body_final.md - gh pr create --repo "${{ github.repository }}" \ - --base litellm_internal_staging \ - --head "$BRANCH" \ + gh pr create --repo "$UPSTREAM_REPO" \ + --base "$UPSTREAM_BASE" \ + --head "leecoder:$BRANCH" \ --title "chore(model_prices): refresh Databricks Foundation Model Serving rates" \ --body-file /tmp/dbx_pr_body_final.md