# Lint YAML files present in the repository.
#
# Currently we only lint semaphore yaml files, to
# avoid excessive confusion from developers by
# throwing unnecessary warnings or errors on arbitrary
# yaml files.
#
# If you want to lint other YAML files in this
# repository, *add a second workflow* and make
# sure that you're specifying file paths in the
# on:pull_request section and in the `with:file_or_dir`
# section of the block itself.
---
name: Yaml Lint
on:  # yamllint disable-line rule:truthy
  pull_request:
    paths:
      - '*.yml'
      - '*.yaml'
      - '.yamllint.yaml'

jobs:
  lintYaml:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - id: yaml-lint
        uses: ibiqlik/action-yamllint@v3
        with:
          file_or_dir: ./
          config_file: .yamllint.yaml
      - uses: actions/upload-artifact@v4
        if: always()
        with:
          name: yamllint-logfile
          path: ${{ steps.yaml-lint.outputs.logfile }}
