When using workflow_dispatch
, it's now possible to have choice
, boolean
and environment
inputs instead of only just strings. choice
is a dropdown, boolean
is a checkbox and environment
is like choice
but will auto-populate with all environments configured in your repos settings.
Here's an example workflow using the new types:
name: CI
on:
workflow_dispatch:
inputs:
environment:
type: environment
description: Select the environment
boolean:
type: boolean
description: True or False
choice:
type: choice
description: Make a choice
options:
- foo
- bar
- baz
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: greet
run: |
echo "environment is ${{ github.event.inputs.environment }} / ${{ inputs.environment }}"
echo "boolean is ${{ github.event.inputs.boolean }}" / ${{ inputs.boolean }}
echo "choice is ${{ github.event.inputs.choice }}" / ${{ inputs.choice }}
Note that inputs can now be accessed directly using the inputs
context, instead of using github.event.inputs
.