-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathaction.yml
More file actions
34 lines (32 loc) · 1.01 KB
/
action.yml
File metadata and controls
34 lines (32 loc) · 1.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
name: flavors_parse
description: Parses the given GardenLinux flavors parameters
inputs:
flags:
description: "Flags passed to `gl-flavors-parse`"
required: true
flavors_matrix:
description: "Generated GitHub workflow flavors matrix"
outputs:
matrix:
description: "Flavors matrix"
value: ${{ steps.matrix.outputs.matrix }}
runs:
using: composite
steps:
- uses: gardenlinux/python-gardenlinux-lib/.github/actions/setup@0.10.11
- id: matrix
shell: bash
run: |
MATRIX='${{ inputs.flavors_matrix }}'
if [[ $(echo "${MATRIX}" | jq -r 'type') != 'object' ]]; then
FLAVORS=$(gl-flavors-parse ${{ inputs.flags }})
MATRIX=$(jq -nc \
--argjson flavors "$(echo $FLAVORS)" \
'{
include: (
$flavors | reduce (to_entries[]) as $item ([]; . + ($item.value | map({"arch": $item.key, "flavor": .})))
)
}'
)
fi
echo "matrix=$MATRIX" | tee -a $GITHUB_OUTPUT