Skip to content

trying matrix write and read #2

trying matrix write and read

trying matrix write and read #2

Workflow file for this run

name: API-test
on:
push:
branches:
- main
permissions:
id-token: write
contents: read
deployments: write
jobs:
API-test-prep:
runs-on: ubuntu-latest
strategy:
matrix:
supportedVersion: ["test1", "test2"]
outputs:
test: ${{ steps.outputTest.outputs.test}}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Reading property files
continue-on-error: true
id: json_props
uses: zoexx/[email protected]
with:
file_path: "./test.json"
- name: testing outputs
id: outputTest
run: |
echo "test=${{matrix.supportedVersion}}" >> $GITHUB_OUTPUT
- name: testing the matrix write
uses: cloudposse/github-action-matrix-outputs-write@v1
id: out
with:
matrix-step-name: ${{ github.job }}
matrix-key: ${{ matrix.supportedVersion }}
outputs: |-
image: ${{ steps.outputTest.outputs.test }}
read:
runs-on: ubuntu-latest
needs: [API-test-prep]
steps:
- uses: cloudposse/github-action-matrix-outputs-read@v1
id: read
with:
matrix-step-name: API-test-prep
outputs:
result: "${{ steps.read.outputs.result }}"
API-test:
needs: read
runs-on: ubuntu-latest
strategy:
matrix:
supportedVersion: ["test1", "test2"]
steps:
- name: test
run: |
echo "test: ${{ fromJson(needs.read.outputs.result).image.test1 }}"