Skip to content

Commit

Permalink
adjusted the yamllint code
Browse files Browse the repository at this point in the history
  • Loading branch information
sangeet-joy_xero committed Sep 19, 2024
1 parent ed6b8ea commit 53f303e
Showing 1 changed file with 7 additions and 12 deletions.
19 changes: 7 additions & 12 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 53f303e

Please sign in to comment.