From 61f1a9eb4f2bed4d617721c75ac2f7ec4ec7ab83 Mon Sep 17 00:00:00 2001 From: mafyuh Date: Thu, 12 Dec 2024 23:38:09 -0500 Subject: [PATCH] Update .forgejo/workflows/yamllint.yml --- .forgejo/workflows/yamllint.yml | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/.forgejo/workflows/yamllint.yml b/.forgejo/workflows/yamllint.yml index e312d66..d1109dc 100644 --- a/.forgejo/workflows/yamllint.yml +++ b/.forgejo/workflows/yamllint.yml @@ -1,5 +1,3 @@ -name: Lint on PR - on: pull_request: types: [opened, synchronize, reopened] @@ -17,16 +15,16 @@ jobs: - name: Get modified YAML files id: get_changed_files run: | - CHANGED_FILES=$(git diff --name-only ${{ github.event.before }} ${{ github.sha }} | grep -E '\.(yml)$' || true) - echo "CHANGED_FILES=$CHANGED_FILES" >> $GITHUB_ENV + CHANGED_FILES=$(git diff --name-only HEAD^ HEAD | grep -E '\.(yml)$' || true) + echo "CHANGED_FILES=$CHANGED_FILES" >> $GITHUB_ENV - name: Run yamllint on modified files if: env.CHANGED_FILES != '' run: | - yamllint $CHANGED_FILES + yamllint $CHANGED_FILES env: CHANGED_FILES: ${{ env.CHANGED_FILES }} - name: Skip linting if no YAML files are changed if: env.CHANGED_FILES == '' - run: echo "No YAML files changed in this PR. Skipping lint." \ No newline at end of file + run: echo "No YAML files changed in this PR. Skipping lint."