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?