Skip to content

Overwrite runs-on defined in workflow_call #26801

Discussion options

You must be logged in to vote

I didn’t think about this yet, it seems you can use expression syntax in runs-on with your input.

Example


on:
  workflow_call:
    inputs:
      runs-on:
        type: string
        default: '["windows-latest"]'
jobs:
  myjoba:
    runs-on: ${{fromJSON(inputs.runs-on)}}
    outputs:
      myout: myin
    steps:
    - run: echo Hello World

Call the workflow with runs-on as input.
Multiple labels

on: push
jobs:
  comp:
    name: comp-${{toJSON(strategy)}}
    uses: ChristopherHX/newcomposite-sample/.github/workflows/weirdworkflow.yml@reusable-workflows
    with:
      runs-on: '["self-hosted", "linux"]'

Single label

on: push
jobs:
  comp:
    uses: ChristopherHX/newcomposite-sample/.git…

Replies: 3 comments

Comment options

You must be logged in to vote
0 replies
Answer selected
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
3 participants