diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 5ea7bb9..88862f7 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -25,18 +25,12 @@ jobs: id: create_matrix run: | # Read the list of YAML files and create a matrix - yaml_files=$(find devices/ -not -name "secrets.yaml" -maxdepth 1 -type f -name "*.yaml" -exec echo {} \; | tr '\n' ' ') - yaml_array="[$(echo "$yaml_files" | sed -e 's/\(.*\)/"\1"/' | paste -sd, -)]" - echo $yaml_array - matrix_json="{\"target\": [" - for yaml_file in "${yaml_files[@]}"; do - matrix_json="$matrix_json{\"yaml_file\": \"$yaml_file\"}," - done - matrix_json="${matrix_json%,}]}" - echo $matrix_json - echo "matrix=$matrix_json" >> $GITHUB_OUTPUT + yaml_files=$(find . -not -name "secrets.yaml" -maxdepth 1 -type f -name "*.yaml" -exec echo {} \; | tr '\n' ' ') + yaml_array="[\"$(echo "$yaml_files" | sed 's/ /", "/g')\"]" + yaml_array=$(echo "$yaml_array" | sed 's/.....$/])/') + echo "matrix=$yaml_array" >> $GITHUB_OUTPUT - name: Debug output - run: echo "${{ steps.create_matrix.outputs.result }}" + run: echo "${{ steps.create_matrix.outputs.matrix }}" build: runs-on: ubuntu-latest needs: matrix_maker