name: dapr-bot

on:
  issue_comment:
    types: [created]
  issues:
    types: [labeled]

jobs:
  daprbot:
    name: bot-processor
    runs-on: ubuntu-latest
    steps:
      - name: Checkout code
        uses: actions/checkout@v4 # required to make the script available for next step
      - name: Comment analyzer
        uses: actions/github-script@v6
        with:
          github-token: ${{secrets.DAPR_BOT_TOKEN}}
          script: |
            const script = require('./.github/scripts/dapr_bot.js')
            await script({github, context})
