feat: add global parameters for app identification headers (#89) #4
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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" |