name: Trigger vectordb-recipers workflow
on:
  push:
    branches: [ main ]
  pull_request:
    paths:
      - .github/workflows/trigger-vectordb-recipes.yml
  workflow_dispatch:

jobs:
  build:
    runs-on: ubuntu-latest

    steps:
      - name: Trigger vectordb-recipes workflow
        uses: actions/github-script@v6
        with:
          github-token: ${{ secrets.VECTORDB_RECIPES_ACTION_TOKEN }}
          script: |
            const result = await github.rest.actions.createWorkflowDispatch({
                owner: 'lancedb',
                repo: 'vectordb-recipes',
                workflow_id: 'examples-test.yml',
                ref: 'main'
            });
            console.log(result);