I have GitHub actions two jobs. One is running a python script to get a list [[file1, 1.0], [file2, 3.0]] and the other is to put this list in the GitHub actions matrix. But I got from python script is a string and it cannot be put into matrix. How to solve this?
on:
pull_request:
branches: [ master, develop ]
types: [ closed ]
jobs:
compute-version:
runs-on: ubuntu-latest
outputs:
list: ${{ steps.semver.outputs.list }}
steps:
- name: Run Computer Version Script
id: semver
run: |
python ./.github/bump-version.py $GITHUB_REF
res=$?
echo "::set-output name=list::$res"
update-yaml:
needs: compute-version
runs-on: ubuntu-latest
strategy:
matrix:
node: ${{needs.compute-version.outputs.bump_list}}
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Update Version on Yaml File
uses: fjogeleit/yaml-update-action@master
with:
valueFile: ${{ matrix.node['file'] }}
propertyPath: info.version
value: ${{ matrix.node['version'] }}
commitChange: true
updateFile: true
targetBranch: ${{needs.compute-version.outputs.target_branch}}
masterBranchName: master
createPR: false
branch: ${{needs.compute-version.outputs.target_branch}}
message: Bump version to ${{ matrix.node['version'] }} in ${{ matrix.node['file'] }}
