From d7317b9d7d8d5c2b8ae92edb4dd01336a6bcb6f1 Mon Sep 17 00:00:00 2001 From: leecoder Date: Tue, 8 Sep 2026 12:51:43 +0900 Subject: [PATCH] ci(workflow): fork-only schedule guard and script bootstrap Two fixes for the fork-run setup: - the monitor audits upstream's registry (checkout pins BerriAI/litellm@litellm_internal_staging), where the script does not exist until #38950 lands - bootstrap it from the fork branch when missing - cron would fire on both repos once merged; guard the job to the fork so only leecoder/litellm opens PRs and upstream never races --- .github/workflows/monitor_databricks_pricing.yml | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/.github/workflows/monitor_databricks_pricing.yml b/.github/workflows/monitor_databricks_pricing.yml index 3b2c19da76b..340aba1727b 100644 --- a/.github/workflows/monitor_databricks_pricing.yml +++ b/.github/workflows/monitor_databricks_pricing.yml @@ -15,12 +15,13 @@ env: FORK_REPO: leecoder/litellm UPSTREAM_REPO: BerriAI/litellm UPSTREAM_BASE: litellm_internal_staging + # carries the monitor script until PR #38950 lands upstream + SCRIPT_REF: feat/dbx-pricing-monitor-clean 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' + # cron would fire on both repos after merge; only the fork may open PRs, or they'd race + if: github.repository == 'leecoder/litellm' runs-on: ubuntu-latest steps: - uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0 @@ -30,6 +31,14 @@ jobs: repository: ${{ env.UPSTREAM_REPO }} ref: ${{ env.UPSTREAM_BASE }} + - name: Bootstrap monitor script until #38950 lands upstream + run: | + if [ ! -f scripts/monitor_databricks_pricing.py ]; then + mkdir -p scripts + curl -fsSL "https://raw.githubusercontent.com/${FORK_REPO}/${SCRIPT_REF}/scripts/monitor_databricks_pricing.py" \ + -o scripts/monitor_databricks_pricing.py + fi + - name: Set up Python uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5.4.0 with: