name: Codespell

on:
  push:
    branches:
      - "**"
  pull_request:
    types: [opened, synchronize, reopened, ready_for_review]

jobs:
  spell-check:
    if: github.event.pull_request.draft == false
    runs-on: ubuntu-latest
    steps:
      - name: Clone repository
        uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 #v6.0.0
        with:
          persist-credentials: false

      - name: Spell-Checking
        uses: codespell-project/actions-codespell@8f01853be192eb0f849a5c7d721450e7a467c579 #v2.2
        with:
          ignore_words_file: .codespellignore
          skip: ./vendor,./package.json,./package-lock.json
