mirror of
https://github.com/wassname/openrouter-python-sdk-retry-errors.git
synced 2026-07-29 11:23:49 +08:00
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.
This commit is contained in:
@@ -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 'python-sdk' from 'OpenRouterTeam/python-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"
|
||||
Reference in New Issue
Block a user