From 5561ffdcec010b1bd347e99f51c2644c4031e627 Mon Sep 17 00:00:00 2001 From: Matt Apperson Date: Sat, 15 Nov 2025 15:52:23 -0500 Subject: [PATCH] feat: add monorepo sync notification workflow Automatically notifies openrouter-web monorepo when changes are pushed to main. This triggers the subtree sync workflow to create a PR with updates. Requires MONOREPO_SYNC_TOKEN secret to be configured. --- .github/workflows/notify-monorepo.yaml | 46 ++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 .github/workflows/notify-monorepo.yaml diff --git a/.github/workflows/notify-monorepo.yaml b/.github/workflows/notify-monorepo.yaml new file mode 100644 index 0000000..b233b98 --- /dev/null +++ b/.github/workflows/notify-monorepo.yaml @@ -0,0 +1,46 @@ +name: Notify Monorepo of Changes + +on: + push: + branches: + - main + +jobs: + notify-monorepo: + runs-on: ubuntu-latest + steps: + - name: Send repository dispatch to monorepo + run: | + # Determine which event type to send based on repository name + REPO_NAME="${GITHUB_REPOSITORY#*/}" # Gets 'typescript-sdk' from 'OpenRouterTeam/typescript-sdk' + + case "$REPO_NAME" in + "typescript-sdk") + EVENT_TYPE="sync-typescript-sdk" + ;; + "python-sdk") + EVENT_TYPE="sync-python-sdk" + ;; + "ai-sdk-provider") + EVENT_TYPE="sync-ai-sdk-provider" + ;; + "cli") + EVENT_TYPE="sync-cli" + ;; + *) + echo "Unknown repository: $REPO_NAME" + exit 1 + ;; + esac + + echo "Sending repository_dispatch event: $EVENT_TYPE" + + curl -L \ + -X POST \ + -H "Accept: application/vnd.github+json" \ + -H "Authorization: Bearer ${{ secrets.MONOREPO_SYNC_TOKEN }}" \ + -H "X-GitHub-Api-Version: 2022-11-28" \ + https://api.github.com/repos/OpenRouterTeam/openrouter-web/dispatches \ + -d "{\"event_type\":\"$EVENT_TYPE\",\"client_payload\":{\"repository\":\"$GITHUB_REPOSITORY\",\"ref\":\"$GITHUB_REF\",\"sha\":\"$GITHUB_SHA\"}}" + + echo "✅ Notification sent to monorepo"