From f518ae43d9c83694b33e670284385bdde1c910e2 Mon Sep 17 00:00:00 2001 From: mafyuh Date: Thu, 12 Dec 2024 23:39:16 -0500 Subject: [PATCH] Update .forgejo/workflows/yamllint.yml --- .forgejo/workflows/yamllint.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.forgejo/workflows/yamllint.yml b/.forgejo/workflows/yamllint.yml index d1109dc..c730b5c 100644 --- a/.forgejo/workflows/yamllint.yml +++ b/.forgejo/workflows/yamllint.yml @@ -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