Skip to content

Commit 72a7a0e

Browse files
committed
Fixed format issue with dynamic env variables
1 parent c01f894 commit 72a7a0e

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

.github/workflows/dotnet-action-sonar-container-workflow.yml

+6-8
Original file line numberDiff line numberDiff line change
@@ -179,22 +179,20 @@ jobs:
179179

180180
- name: Display Action Outputs
181181
if: ${{ needs.build.outputs.mode == 'test' }}
182-
env: ${{ fromJSON(steps.maven-artifacts.outputs.update_json) }}
183182
run: |
184183
echo "Action Outputs:"
185184
echo "- [has_updates]: ${{ steps.maven-artifacts.outputs.has_updates }}"
186185
echo "- [number_of_updates]: ${{ steps.maven-artifacts.outputs.number_of_updates }}"
187186
echo "- [update_json]: ${{ steps.maven-artifacts.outputs.update_json }}"
188187
echo ""
189188
echo "Deserialized Update JSON:"
190-
echo "- [parents]: $parents"
191-
echo "- [dependencies]: $dependencies"
192-
echo "- [plugins]: ${{ fromJSON(steps.maven-artifacts.outputs.update_json).plugins }}" # Alternative
189+
echo "- [parents][0]: ${{ fromJSON(steps.maven-artifacts.outputs.update_json).parents[0] }}"
190+
echo "- [dependencies][0]: ${{ fromJSON(steps.maven-artifacts.outputs.update_json).dependencies[0] }}"
191+
echo "- [plugins][0]: ${{ fromJSON(steps.maven-artifacts.outputs.update_json).plugins[0] }}"
193192
echo ""
194-
195-
# One approach to processing an array type field using bash:
196-
array=($(echo "$plugins" | jq -r '.[]'))
197-
for element in "${array[@]}"; do
193+
194+
echo "One approach to processing an array type field using bash:"
195+
for element in ${{ join(fromJSON(steps.maven-artifacts.outputs.update_json).plugins, ' ') }}; do
198196
IFS=":" read -r groupId artifactId version <<< "$element"
199197
echo "groupId: $groupId"
200198
echo "artifactId: $artifactId"

0 commit comments

Comments
 (0)