name: Check Workflow Files

on:
  push:
    branches:
      - main

  merge_group:
  pull_request:

defaults:
  run:
    shell: bash

jobs:
  actions:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v4
        with:
          submodules: true

      - name: Install action-validator with asdf
        uses: asdf-vm/actions/install@v3
        with:
          tool_versions: |
            action-validator 0.5.1

      - name: Lint Actions
        run: |
          find .github/workflows -type f \( -iname \*.yaml -o -iname \*.yml \) \
            | xargs -I {} action-validator --verbose {}