Update .forgejo/workflows/yamllint.yml

This commit is contained in:
Matt Reeves 2024-12-12 23:39:16 -05:00
parent 61f1a9eb4f
commit f518ae43d9

View file

@ -15,7 +15,11 @@ jobs:
- name: Get modified YAML files
id: get_changed_files
run: |
CHANGED_FILES=$(git diff --name-only HEAD^ HEAD | grep -E '\.(yml)$' || true)
if git rev-parse --verify HEAD^ >/dev/null 2>&1; then
CHANGED_FILES=$(git diff --name-only HEAD^ HEAD | grep -E '\.(yml)$' || true)
else
CHANGED_FILES=$(git diff --name-only $(git hash-object -t tree /dev/null) HEAD | grep -E '\.(yml)$' || true)
fi
echo "CHANGED_FILES=$CHANGED_FILES" >> $GITHUB_ENV
- name: Run yamllint on modified files