name: Command

on:
  issue_comment:
    types: [created]

jobs:
  dispatch:
    name: Dispatch
    runs-on: ubuntu-latest

    steps:
      - name: Dispatch website preview
        uses: peter-evans/slash-command-dispatch@v3
        with:
          token: ${{ secrets.COMMAND_DISPATCH_TOKEN }}
          issue-type: pull-request
          dispatch-type: workflow
          commands: website-preview
          static-args: |
            pull-request-number=${{ github.event.issue.number }}
