Home > Net >  How to create a dropdown in a GitHub action job
How to create a dropdown in a GitHub action job

Time:11-12

My job needs to receive 2 input parameter from the user. Valid values of those parameters are defined by a separate script. These values can change (not able to hard code them) so I want to populate the list dynamically when the job is to be run. The picker should update according to the result of the script allowing the user to select and only then should the actual job be run with those values as input to the job

Question is how to provide a drop down like that

CodePudding user response:

Since Nov. 2021, the input type can actually be a choice list.

GitHub Actions: Input types for manual workflows

You can now specify input types for manually triggered workflows allowing you to provide a better experience to users of your workflow.
In addition to the default string type, we now support choice, boolean, and environment.

name: Mixed inputs

on:
  workflow_dispatch:
    inputs:
      name:
        type: choice
        description: Who to greet
        options: 
        - monalisa
        - cschleiden
      message:
        required: true
      use-emoji:
        type: boolean
        description: Include            
  • Related