Question: I have a workflow\_dispatch trigger like blow:

[![enter image description here](https://i.stack.imgur.com/nj7Iq.png)](https://i.stack.imgur.com/nj7Iq.png)

I need to define validation, so that logLevel must be within specific set of values `['info', 'warning', 'error']`

I know I can do bash if commands and check for values. But I prefer not doing that.

Is there a built-in way of doing that?

Answer: 
Manually triggered workflows in Github Actions now supports `choice` as an input type, so you can do something like this and the user will see this as a dropdown.

```yaml
on:
  workflow_dispatch:
    inputs:
      logLevel:
        type: choice
        description: Log level
        default: warning
        options:
        - info
        - warning
        - error

```
I don't think there's currently a built-in way to do this, but you can accomplish it by doing something like:

1. Create a validator script (eg. `.github/scripts/validateInputs.js`)

```js
if (['info', 'warning', 'error'].includes(process.env.logLevel)) {
  console.log("logLevel must be either 'info', 'warning' or 'error'");
  process.exit(1);
}

```

2. Add it as a new step to your job

```
- name: Validate logLevel
  run: logLevel=${{ github.event.inputs.logLevel }} node .github/scripts/validateInputs.js

```