From b1d8440c4006f3d613aab3e727fc661b8a6ba276 Mon Sep 17 00:00:00 2001 From: dtor Date: Fri, 15 Nov 2024 12:38:20 +0000 Subject: [PATCH] fix: wrong yamllint skip Fixes by splitting the string and iterating over it --- .github/workflows/yamllint.yml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/yamllint.yml b/.github/workflows/yamllint.yml index 9eb8eec..a61c89e 100644 --- a/.github/workflows/yamllint.yml +++ b/.github/workflows/yamllint.yml @@ -22,7 +22,15 @@ jobs: pip install yamllint - name: Lint YAML files run: |- - if echo "${{ steps.changed_files.outputs.all }}" | grep -qE '\.(yml|yaml)$'; then + IFS=' ' read -r -a files <<< "${{ steps.changed_files.outputs.all }}" + yaml_files=() + for file in "${files[@]}"; do + if [[ "$file" == *.yaml || "$file" == *.yml ]]; then + yaml_files+=("$file") + fi + done + + if [ ${#yaml_files[@]} -gt 0 ]; then echo -e "Running yamllint" yamllint . || exit 1 else