From 53f303ea4ca1bd8ee9546623e0ec21022c04e5da Mon Sep 17 00:00:00 2001 From: sangeet-joy_xero Date: Thu, 19 Sep 2024 11:36:50 +0530 Subject: [PATCH] adjusted the yamllint code --- .github/workflows/pr.yml | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 623ce38ba..607cc0e3a 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -21,21 +21,16 @@ jobs: - name: Install yaml lint run: pip install yamllint - - name: Get list of changed files - id: changed_files + - name: Run yamllint run: | - git fetch origin ${{github.base_ref}} --depth=1 - git diff --name-only origin/${{github.base_ref}}...HEAD > changed_files.txt - grep -E '\.ya?ml$' changed_files.txt > yaml_files.txt || true + git checkout ${{github.head_ref}} + + find . -type f \( - name "*.yaml" \) > yaml_files.txt - - name: Run yaml lint on changed files - run: | if [ -s yaml_files.txt ]; then - echo "Linting the following yaml files:" - cat yaml_files.txt - xargs yamllint < yaml_files.txt - else - echo 'no yaml files changed' + echo "linting the following yaml files:" + cat yaml_files.txt + xargs yamllint < yaml_files.txt fi # - name: Checkout codegen repo