Skip to content

Change outside quotes #6

Change outside quotes

Change outside quotes #6

Workflow file for this run

---
name: Test Loop
on:
push:
branches: [development]
jobs:
# Job 1: Collect data
define-matrix:
runs-on: ubuntu-latest
outputs:
colors: ${{ steps.colors.outputs.colores }}
project-json: ${{ steps.json-project-step.outputs.json-project }}
steps:
- name: Define Colors
id: colors
run: |
echo 'colores=["red", "green", "blue"]' >> "$GITHUB_OUTPUT"
- name: Define JSON
id: json-project-step
run: |
echo 'json-project={\"count\":4,\"include\":[{\"project\":\"foo\",\"config\":\"Debug\"},{\"project\":\"bar\",\"config\":\"Release\"}]}'
>> $GITHUB_OUTPUT
## Job 2: Print the output of the "define-matrix" job
print-output:
runs-on: ubuntu-latest
needs: define-matrix
steps:
- name: Print colors variable
run: |
echo ${{ needs.define-matrix.outputs.colors }}
- name: Print project-json variable
run: |
echo ${{ needs.define-matrix.outputs.project-json }}
# Job 3: Display data using "run" and "with"
# produce-artifacts:
# runs-on: ubuntu-latest
# needs: define-matrix
# strategy:
# matrix:
# color: ${{ fromJSON(needs.define-matrix.outputs.colors) }}
# steps:
# - name: Define Color
# env:
# color: ${{ matrix.color }}
# run: |
# echo "$color" > color
# - name: Produce Artifact
# uses: actions/upload-artifact@v4
# with:
# name: ${{ matrix.color }}
# path: color
# - run: mkdir -p path/to/artifact
# - run: echo hello > path/to/artifact/world.txt
# - uses: actions/upload-artifact@v4
# with:
# name: my-artifact
# path: path/to/artifact/world.txt
# Job 4: Display data another way
# consume-artifacts:
# runs-on: ubuntu-latest
# needs:
# - define-matrix
# - produce-artifacts
# strategy:
# matrix:
# color: ${{ fromJSON(needs.define-matrix.outputs.colors) }}
# steps:
# - name: Retrieve Artifact
# uses: actions/download-artifact@v4
# with:
# name: ${{ matrix.color }}
# - name: Report Color
# run: |
# cat color