feat: add copybara sync workflow for monorepo integration

This commit is contained in:
Matt Apperson
2026-01-12 20:10:30 -05:00
parent f190e3f950
commit 66d0a82776
+41
View File
@@ -0,0 +1,41 @@
name: Copybara Sync
on:
push:
branches: [main]
pull_request_target:
types: [opened, synchronize, reopened]
jobs:
copybara:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: olivr/copybara-action@v1.2.5
with:
ssh_key: ${{ secrets.COPYBARA_SSH_KEY }}
access_token: ${{ secrets.MONOREPO_SYNC_TOKEN }}
sot_repo: OpenRouterTeam/python-sdk
destination_repo: OpenRouterTeam/openrouter-web
push_move: '||sdks/python||**'
push_exclude: '.github/workflows/copybara-sync.yaml .github/workflows/sdk_publish.yaml'
trigger-sdk-regen:
needs: copybara
if: github.event_name == 'push'
runs-on: ubuntu-latest
steps:
- name: Dispatch SDK regeneration
uses: actions/github-script@v7
with:
github-token: ${{ secrets.MONOREPO_SYNC_TOKEN }}
script: |
await github.rest.repos.createDispatchEvent({
owner: 'OpenRouterTeam',
repo: 'openrouter-web',
event_type: 'sdk-regen-python',
client_payload: { sha: context.sha }
});