vaibhav.yadav
Fri May 31 2024
Using
Choice input in Github actions can be used to provide a predefined list of options for workflow dispatch events. This makes it easier for users to select from a set of valid options when triggering workflows manually.
Example:
#githubactions #devops #automation #dropdown
choice
Input in GitHub ActionsChoice input in Github actions can be used to provide a predefined list of options for workflow dispatch events. This makes it easier for users to select from a set of valid options when triggering workflows manually.
Example:
name: Example Workflow
on:
workflow_dispatch:
inputs:
environment:
description: 'Select the environment'
required: true
default: 'sandbox'
type: choice
options:
- sandbox
- uat
- production
jobs:
example_job:
runs-on: ubuntu-latest
steps:
- name: Display Inputs
run: |
echo "Environment: ${{ github.event.inputs.environment }}"
#githubactions #devops #automation #dropdown