-
Notifications
You must be signed in to change notification settings - Fork 16
46 lines (40 loc) · 1.42 KB
/
notify-monorepo.yaml
File metadata and controls
46 lines (40 loc) · 1.42 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
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"