name: Linting Workflow
on:
  push:
    paths-ignore:
      - '.gitignore'
      - 'LICENSE'
      - 'README*'
      - 'docs/**'
    branches: ['2.6.x']
  pull_request:
    paths-ignore:
      - '.gitignore'
      - 'LICENSE'
      - 'README*'
      - 'docs/**'
    branches: ['2.6.x']

concurrency:
  # Only run once for latest commit per ref and cancel other (previous) runs.
  group: ${{ github.workflow }}-${{ github.ref }}
  cancel-in-progress: true

jobs:
  lint:
    name: Lint
    runs-on: ubuntu-22.04
    if: github.repository_owner == 'Apicurio' && !contains(github.event.*.labels.*.name, 'DO NOT MERGE')
    steps:
      - name: Checkout Code with Ref '${{ github.ref }}'
        uses: actions/checkout@v3

      - name: Install tools
        run: .github/scripts/install-tools.sh

      - name: Run linter
        run: ./scripts/validate-files.sh
