name: Trigger Consumer CI

# When common platform packages change, trigger downstream consumer test suites
on:
  push:
    branches: [main]
    paths:
      - "packages/**"

jobs:
  trigger-lysnrai:
    name: Trigger LysnrAI Dashboard CI
    runs-on: ubuntu-latest
    steps:
      - name: Trigger LysnrAI workflows
        uses: peter-evans/repository-dispatch@v3
        with:
          token: ${{ secrets.CROSS_REPO_PAT }}
          repository: saravanakumardb1/learning_voice_ai_agent
          event-type: common-platform-updated
          client-payload: '{"ref": "${{ github.sha }}", "packages": "updated"}'

  trigger-mindlyst:
    name: Trigger MindLyst CI
    runs-on: ubuntu-latest
    steps:
      - name: Trigger MindLyst workflows
        uses: peter-evans/repository-dispatch@v3
        with:
          token: ${{ secrets.CROSS_REPO_PAT }}
          repository: saravanakumardb1/learning_multimodal_memory_agents
          event-type: common-platform-updated
          client-payload: '{"ref": "${{ github.sha }}", "packages": "updated"}'
