forked from docs/doc-exports
customizing filter
This commit is contained in:
@ -22,7 +22,23 @@ jobs:
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y yamllint
|
||||
|
||||
- name: Run yamllint
|
||||
# Lint all YAML/YML files in the repo
|
||||
- name: Run yamllint on changed YAML files
|
||||
run: |
|
||||
yamllint .
|
||||
set -e
|
||||
|
||||
# Fetch base branch so git diff works in PRs
|
||||
git fetch origin "${{ gitea.base_ref }}"
|
||||
|
||||
# Get changed YAML files
|
||||
files=$(git diff --name-only origin/${{ gitea.base_ref }}...HEAD \
|
||||
| grep -E '\.(yml|yaml)$' || true)
|
||||
|
||||
if [ -z "$files" ]; then
|
||||
echo "✅ No YAML files changed"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
echo "🔍 Linting changed files:"
|
||||
echo "$files"
|
||||
|
||||
yamllint -f parsable $files
|
||||
Reference in New Issue
Block a user