最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

Using inputs inside a GitHub Actions matrix - Stack Overflow

programmeradmin1浏览0评论

Having the following code snippet:

on:
  workflow_call:
    inputs:
      TEST_CLASS:
        type: string
        required: true

jobs:
  execute-test:
    name: execute-test
    strategy:
      max-parallel: 1
      matrix:
        test_class: ${{ 
          ( inputs.TEST_CLASS == 'All' && fromJson('["A", "B", "C"') )  ||
          ( inputs.TEST_CLASS != 'All' && fromJson('["' + inputs.TEST_CLASS + '"]') )
        }}

but I am not able to successfully run the second case. Goal is to run a predefined list of classes in the first case, and only the test class entered as input for the second case.

I suppose I am wrong when trying to evaluate the expression but I tried all possible ways without any success. Is there any way I can retrieve the input value inside the fromJson function in such case?

发布评论

评论列表(0)

  1. 暂无评论