name: Docs Trigger Translations On Release

on:
  release:
    types:
      - published

permissions:
  contents: read

jobs:
  dispatch-translate:
    runs-on: ubuntu-latest
    steps:
      - name: Trigger translation coordinator in publish repo
        env:
          GH_TOKEN: ${{ secrets.OPENCLAW_DOCS_SYNC_TOKEN }}
          RELEASE_TAG: ${{ github.event.release.tag_name }}
        run: |
          set -euo pipefail
          gh api repos/openclaw/docs/dispatches \
            --method POST \
            -f event_type="translate-all-release" \
            -f client_payload[mode]="incremental" \
            -f client_payload[release_tag]="${RELEASE_TAG}" \
            -f client_payload[source_repository]="${GITHUB_REPOSITORY}" \
            -f client_payload[source_sha]="${GITHUB_SHA}"
