小编Sas*_*cha的帖子

如何将 GitHub Actions 矩阵的字符串转换为数组?

我在 GitHub Actions 中有两份工作。一种是运行 Python 脚本来获取列表 [[file1, 1.0], [file2, 3.0]],另一种是将这个列表放入 GitHub Actions 矩阵中。我从 Python 脚本中收到一个无法放入矩阵中的字符串。我该如何解决这个问题?

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 …
Run Code Online (Sandbox Code Playgroud)

github-actions

5
推荐指数
2
解决办法
1万
查看次数

标签 统计

github-actions ×1