name: "Verify files formatting"

on:
  push:
    paths:
      - "**/*.md"
      - "**/*.yml"
      - "**/*.yaml"
      - ".prettierrc"
      - ".prettierignore"
  pull_request:
    paths:
      - "**/*.md"
      - "**/*.yml"
      - "**/*.yaml"
      - ".prettierrc"
      - ".prettierignore"

jobs:
  verify-formatting:
    runs-on: ubuntu-latest

    steps:
      - name: Checkout
        uses: actions/checkout@v2

      - name: Install Taskfile
        uses: Arduino/actions/setup-taskfile@master
        with:
          repo-token: ${{ secrets.GITHUB_TOKEN }}
          version: 3.x

      - name: Verify formatting of all files
        run: task docs:check config:check
