name: Command Dispatch for PR events
on:
  issue_comment:
    types: [created]

# Enables maintainers with "write" permission to trigger jobs on external pull requests.

jobs:
  command-dispatch:
    runs-on: ubuntu-latest
    steps:
      - name: Dispatch command
        uses: peter-evans/slash-command-dispatch@v2
        with:
          token: ${{ secrets.PULUMI_BOT_TOKEN }}
          reaction-token: ${{ secrets.GITHUB_TOKEN }}
          permission: write
          issue-type: pull-request
          repository: pulumi/pulumi
          commands: |
            run-acceptance-tests
            run-docs-gen
            run-codegen