Skip to content

Commit 5561ffd

Browse files
committed
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.
1 parent 9576ea4 commit 5561ffd

File tree

1 file changed

+46
-0
lines changed

1 file changed

+46
-0
lines changed
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Notify Monorepo of Changes
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
notify-monorepo:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Send repository dispatch to monorepo
13+
run: |
14+
# Determine which event type to send based on repository name
15+
REPO_NAME="${GITHUB_REPOSITORY#*/}" # Gets 'typescript-sdk' from 'OpenRouterTeam/typescript-sdk'
16+
17+
case "$REPO_NAME" in
18+
"typescript-sdk")
19+
EVENT_TYPE="sync-typescript-sdk"
20+
;;
21+
"python-sdk")
22+
EVENT_TYPE="sync-python-sdk"
23+
;;
24+
"ai-sdk-provider")
25+
EVENT_TYPE="sync-ai-sdk-provider"
26+
;;
27+
"cli")
28+
EVENT_TYPE="sync-cli"
29+
;;
30+
*)
31+
echo "Unknown repository: $REPO_NAME"
32+
exit 1
33+
;;
34+
esac
35+
36+
echo "Sending repository_dispatch event: $EVENT_TYPE"
37+
38+
curl -L \
39+
-X POST \
40+
-H "Accept: application/vnd.github+json" \
41+
-H "Authorization: Bearer ${{ secrets.MONOREPO_SYNC_TOKEN }}" \
42+
-H "X-GitHub-Api-Version: 2022-11-28" \
43+
https://api.github.com/repos/OpenRouterTeam/openrouter-web/dispatches \
44+
-d "{\"event_type\":\"$EVENT_TYPE\",\"client_payload\":{\"repository\":\"$GITHUB_REPOSITORY\",\"ref\":\"$GITHUB_REF\",\"sha\":\"$GITHUB_SHA\"}}"
45+
46+
echo "✅ Notification sent to monorepo"

0 commit comments

Comments
 (0)