From 66d0a82776b5e01cdf2c16af042a0f985c9c3d1f Mon Sep 17 00:00:00 2001 From: Matt Apperson Date: Mon, 12 Jan 2026 20:10:30 -0500 Subject: [PATCH] feat: add copybara sync workflow for monorepo integration --- .github/workflows/copybara-sync.yaml | 41 ++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 .github/workflows/copybara-sync.yaml diff --git a/.github/workflows/copybara-sync.yaml b/.github/workflows/copybara-sync.yaml new file mode 100644 index 0000000..0184347 --- /dev/null +++ b/.github/workflows/copybara-sync.yaml @@ -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 } + });