name: Typos Check
on:
  workflow_dispatch:
  push:
  pull_request:
    types: [opened, synchronize, reopened]

jobs:
  run:
    name: Spell Check with Typos
    runs-on: ubuntu-latest
    steps:
    - name: Checkout Actions Repository
      uses: actions/checkout@v4
      with:
        ref: ${{ github.ref_name }}
    - name: Create config file
      run: |
        cat <<EOF > typo-check-config.toml
        [files]
        extend-exclude = [
          "**/*_svg",
          "**/migrations/**",
          "**/loopEdge.ts",
          "**/edge.ts",
        ]
        EOF
    - name: Check spelling
      uses: crate-ci/typos@master
      with:
        config: ./typo-check-config.toml
