runner icon indicating copy to clipboard operation
runner copied to clipboard

Can we set runs-on: parameter during run time

Open swathida-byte opened this issue 3 years ago • 3 comments

I have a requirement where I need to run the second job using the output of the first job the first job runs and decides on which runner the second job has to run so my requirement is can the runs-on parameter take variable ???

swathida-byte avatar Nov 16 '22 12:11 swathida-byte

While I haven't tried, taking a quick look at the workflow definition, the below code should be good.

needs: job1
runs-on: ${{needs.job1.outputs.output1}}

fhammerl avatar Nov 16 '22 14:11 fhammerl

    name: CI_BUILD_APP
    needs: [CI_TRIGGER_APP]
    runs-on: ${{needs.CI_TRIGGER_APP.outputs.node-label}}
getting the below error 

Error when evaluating 'runs-on' for job 'CI_BUILD_APP'. .github/workflows/CI_BUILD_APP.yaml (Line: 166, Col: 14): Unexpected type of value '', expected type: OneOf.

swathida-byte avatar Nov 16 '22 18:11 swathida-byte

yeah as far as I checked, runs-on only accepts input params, not any like env or ouputs...

johnpaulkj avatar Dec 06 '22 13:12 johnpaulkj

@fhammerl Any updates on this?

kishaningithub avatar Aug 02 '23 10:08 kishaningithub