name: PR Conventional Commit Validation

on:
  pull_request_target:
    types: [opened, synchronize, reopened, edited]

jobs:
  validate-pr-title:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/create-github-app-token@v3.1.1
        id: app-token
        with:
          client-id: ${{ vars.DS_RELEASE_BOT_CLIENT_ID }}
          private-key: ${{ secrets.DS_RELEASE_BOT_PRIVATE_KEY }}
          permission-pull-requests: write

      - name: PR Conventional Commit Validation
        uses: ytanikin/pr-conventional-commits@1.5.2
        with:
          task_types: '["feat","fix","docs","test","ci","refactor","perf","chore","revert"]'
          token: ${{ steps.app-token.outputs.token }}
