File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 99 shell : bash
1010 run : |
1111 VERSIONS=$(gh api /repos/${{ github.repository }}/properties/values | jq -r '.[] | select(.property_name == "DOTNET") | .value')
12- VERSIONS=$(echo "$VERSIONS" | tr ',' '\n')
13- echo "versions=$VERSIONS" >> $GITHUB_OUTPUT
12+ # Convert comma-separated to newline-separated
13+ NEWLINE_VERSIONS=$(echo "$VERSIONS" | tr ',' '\n')
14+ # Validate versions
15+ while IFS= read -r version; do
16+ if ! [[ $version =~ ^[0-9]+(\.[0-9]+(\.[0-9]+)?)?(\.x)?$ ]]; then
17+ echo "Error: Invalid version format: $version"
18+ exit 1
19+ fi
20+ done <<< "$NEWLINE_VERSIONS"
21+ # Write multiline output to $GITHUB_OUTPUT
22+ {
23+ echo 'versions<<EOF'
24+ echo "$NEWLINE_VERSIONS"
25+ echo 'EOF'
26+ } >> $GITHUB_OUTPUT
27+
28+ - name : ⚙ versions
29+ if : steps.dotnet.outputs.versions != ''
30+ shell : bash
31+ run : |
32+ echo "Versions:"
33+ echo "${{ steps.dotnet.outputs.versions }}"
1434
1535 - name : ⚙ dotnet
1636 if : steps.dotnet.outputs.versions != ''
1737 uses : actions/setup-dotnet@v4
1838 with :
1939 dotnet-version : |
20- ${{ join(split( steps.dotnet.outputs.versions, ','), '\n') }}
40+ ${{ steps.dotnet.outputs.versions }}
You can’t perform that action at this time.
0 commit comments