Skip to content

Commit

Permalink
Update workflow.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
landonr authored Sep 13, 2023
1 parent 459753a commit 34d52c8
Showing 1 changed file with 5 additions and 11 deletions.
16 changes: 5 additions & 11 deletions .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 34d52c8

Please sign in to comment.