name: Dispatch to docs repo

on:
  push:
    branches: [main]
    paths:
      - 'docs/**'
  workflow_dispatch:

jobs:
  dispatch:
    runs-on: ubuntu-latest
    strategy:
      matrix:
        repo: ["All-Hands-AI/docs"]
    steps:
      - name: Push to docs repo
        uses: peter-evans/repository-dispatch@v3
        with:
          token: ${{ secrets.ALLHANDS_BOT_GITHUB_PAT }}
          repository: ${{ matrix.repo }}
          event-type: update
          client-payload: '{"ref": "${{ github.ref }}", "sha": "${{ github.sha }}", "module": "openhands", "branch": "main"}'
