Github Actions - Multiselect Dropdown as part of inputs that allows user to select/deselect options at runtime #28048
Replies: 1 comment
-
Hey @mselukar008, and others who might be interested, I hope you are well. I was looking at possible discussions/ raised issues that my action Interactive Inputs could help to address, and this is a use case that falls under the offered feature of Interactive Inputs. My action enables users to enable runtime inputs in their workflows/actions and support various input field types, including but not limited to How could it help you?Based on your request, I created the following workflow which leverages Interactive Inputs. See the flow live with the video below.
name: '[Example] Multiselect to invoke other flows'
on:
push:
jobs:
interactive-inputs:
runs-on: ubuntu-latest
permissions:
contents: write
actions: write
steps:
- name: Example Interactive Inputs Step
id: interactive-inputs
uses: boasiHQ/interactive-inputs@v2
with:
timeout: 300
title: 'We need you to select your desired flow(s) to execute'
interactive: |
fields:
- label: runtime-options
properties:
description: Below are the available flows that can be executed
display: Select the flow(s) to execute
type: multiselect
choices:
["option-a", "option-b", "option-c"]
required: true
- label: notes
properties:
display: Optional - Additional note(s)
type: textarea
description: Additional notes on why this selection was made.
notifier-slack-enabled: "false"
notifier-slack-channel: "#random"
notifier-slack-token: ${{ secrets.SLACK_TOKEN }}
notifier-discord-enabled: "false"
notifier-discord-webhook: ${{ secrets.DISCORD_WEBHOOK }}
github-token: ${{ github.token }}
ngrok-authtoken: ${{ secrets.NGROK_AUTHTOKEN }}
outputs:
runtime-options: ${{ steps.interactive-inputs.outputs.runtime-options }}
option-a:
runs-on: ubuntu-latest
needs: ["interactive-inputs"]
if: ${{ contains( needs.interactive-inputs.outputs.runtime-options, 'option-a' ) }}
steps:
- name: Run option-a
shell: bash
run: |
echo "Running flow option-a "
echo -e "\n==============================\n"
echo "Detected Selection: ${{join(needs.interactive-inputs.outputs.runtime-options, '\n')}}"
echo -e "\n==============================\n"
option-b:
runs-on: ubuntu-latest
needs: ["interactive-inputs"]
if: ${{ contains( needs.interactive-inputs.outputs.runtime-options, 'option-b' ) }}
steps:
- name: Run option-b
shell: bash
run: |
echo "Running flow option-b "
echo -e "\n==============================\n"
echo "Detected Selection: ${{join(needs.interactive-inputs.outputs.runtime-options, '\n')}}"
echo -e "\n==============================\n"
option-c:
runs-on: ubuntu-latest
needs: ["interactive-inputs"]
if: ${{ contains( needs.interactive-inputs.outputs.runtime-options, 'option-c' ) }}
steps:
- name: Run option-c
shell: bash
run: |
echo "Running flow option-c "
echo -e "\n==============================\n"
echo "Detected Selection: ${{join(needs.interactive-inputs.outputs.runtime-options, '\n')}}"
echo -e "\n==============================\n" In action |
Beta Was this translation helpful? Give feedback.
-
Hello Members,
I have created a GitHub action workflow for executing UI automation regression tests. The trigger events are manual dispatch and scheduled run. For both these events, I have 10 inputs out of which one is for test suites. My requirement is to have a drop-down/choice parameter that allows user to select multiple options from default values of dropdown at runtime, this implementation is already available in jenkins for parameterized pipelines with Extended choice parameters. Do we have similar implementation for inputs ? If not , is there any workaround for handling such scenario ?
Appreciate your response well in advanced.
Beta Was this translation helpful? Give feedback.
All reactions