0

I have a requirement to enter multiple inputs using workflow_dispatch and use matrix to play with them.

Fox Example:

I have 10 repositories. When user runs a workflow manually, he/she will need to provide 5/6 repositories as input at a time. I can see workflow_dispatch option, currently supports only string as an input. Is there anyway to deal with this situation using github actions?

love
  • 1,000
  • 2
  • 16
  • 35

1 Answers1

1

So workflow_dispatch events actually support 3 input types; choice, environment, boolean.

I don't think you'll be able to pass inputs for matrix tasks that expect a list of values though (you can definitely do it for single values

If there are only several inputs you might be able to use multiple booleans and conditionally run jobs or steps. Not as clean clean but will do the job.

on:
  workflow_dispatch:
    inputs:
      repo_1:
        type: boolean
        default: false
        description: Use Repo 1?
      repo_2:
        type: boolean
        default: false
        description: Use Repo 2?
jobs:
  repo-1-job:
    name: Repo 1 Job
    runs-on: ubuntu-latest
    if: github.event.inputs.repo_1 == 'true'
    steps:
      - run: echo "some repo 1 job"
  
  repo-2-job:
    name: Repo 2 Job
    runs-on: ubuntu-latest
    if: github.event.inputs.repo_2 == 'true'
    steps:
      - run: echo "some repo 2 job"