ci: add yamllint workflow to detect duplicate YAML keys (#36010)

* ci: add yamllint workflow to detect duplicate YAML keys

Add a yamllint check for workflow files to catch duplicate keys that
YAML parsers silently accept but GitHub Actions rejects on the default
branch.

Release Note
NONE

Co-authored-by: Claude <claude@anthropic.com>

* ci: address review feedback on yamllint workflow

- Add permissions: contents: read (least privilege)
- Bump checkout to v6.0.2 with persist-credentials: false
- Remove pip install step (yamllint is pre-installed on ubuntu-22.04)

Co-authored-by: Claude <claude@anthropic.com>

---------

Co-authored-by: Claude <claude@anthropic.com>
This commit is contained in:
Pavel Zeman
2026-04-20 17:25:12 -04:00
committed by GitHub
co-authored by Claude
parent 5b810f917c
commit 9c8191c3b8
2 changed files with 35 additions and 0 deletions
+28
View File
@@ -0,0 +1,28 @@
name: YAML Lint
on:
push:
branches:
- master
- release-*
pull_request:
paths:
- ".github/workflows/**"
- ".yamllint"
concurrency:
group: ${{ github.event_name == 'pull_request' && format('{0}-{1}', github.workflow, github.ref) || github.run_id }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
permissions:
contents: read
jobs:
yamllint:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: Lint workflow YAML files
run: yamllint .github/workflows/