name: Lint plugin readmes
on:
#  push:
#    branches-ignore: master
  pull_request:
    branches: # Names of target branches, not source branches
      - master
jobs:
  run-readme-linter:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/setup-go@v6
        with:
          go-version: '1.26.2'
      - uses: actions/checkout@v6
        with:
          fetch-depth: 0
      - name: Get changed files
        id: changed-files
        uses: tj-actions/changed-files@9426d40962ed5378910ee2e21d5f8c6fcbf2dd96 # v47.0.6
        with:
          base_sha: ${{ github.event.pull_request.base.sha }}
          files: ./plugins/**/README.md
      - name: Run readme linter on changed files
        if: steps.changed-files.outputs.any_changed == 'true'
        run: go run ./tools/readme_linter ${{ steps.changed-files.outputs.all_changed_files }}
