name: dapr-bot

on:
  issue_comment:
    types: [created]

jobs:
  bot-run:
    name: bot-processor
    runs-on: ubuntu-latest
    permissions:
      issues: write
      contents: read
    env:
      GITHUB_TOKEN: ${{ github.token }}

    steps:
      - name: Checkout code
        uses: actions/checkout@v4

      - name: Setup Golang
        uses: actions/setup-go@v4
        with:
          go-version-file: "./.github/workflows/dapr-bot/go.mod"
          cache-dependency-path: |
            ./.github/workflows/dapr-bot/

      - name: go-bot-mod
        working-directory: ./.github/workflows/dapr-bot/
        run: go mod tidy

      - name: go-bot-run
        working-directory: ./.github/workflows/dapr-bot/
        run: go run .
