Skip to content

Commit

Permalink
Another version of job matrix
Browse files Browse the repository at this point in the history
  • Loading branch information
mcasas993 committed Nov 19, 2024
1 parent 892f6eb commit 38b4c35
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -121,12 +121,17 @@ jobs:
steps:
- id: setup
run: |
distribution_array=$(echo '${{ inputs.distribution }}' | jq -R 'split(",")')
architecture_array=$(echo '${{ inputs.architecture }}' | jq -R 'split(",")')
matrix=$(jq -n \
--argjson distribution "$distribution_array" \
--argjson architecture "$architecture_array" \
'{distribution: $distribution, architecture: $architecture}')
# Asignar las entradas a variables
distribution="${{ inputs.distribution }}"
architecture="${{ inputs.architecture }}"
# Generar el JSON utilizando jq
matrix=$(jq -cn \
--argjson distribution "$(echo $distribution | jq -R 'split(",")')" \
--argjson architecture "$(echo $architecture | jq -R 'split(",")')" \
'{distribution: $distribution, architecture: $architecture}')
# Guardar el resultado en GITHUB_OUTPUT
echo "matrix=$matrix" >> $GITHUB_OUTPUT
build-wazuh-plugins:
Expand Down

0 comments on commit 38b4c35

Please sign in to comment.