Right now, we're running a manual workflow in order to deploy our product to production. We have one input and we can choose our brand which needs to be deployed.
It's including options like
on:
workflow_dispatch:
inputs:
dst:
type: choice
description: Select destination brand
required: true
options:
- A
- B
- C
and so on
My question is, is it possible to read this options from a file (like a text file which is in our project)? I looked at it but I couldn't see a solution from others.
Thank you so much!
No - it's not possible to have dynamic workflow configurations at the moment, I'm afraid.
The solution I personally use is to trigger this type of workflow using workflow_dispatch event with proper input options.
Instead of triggering it manually on web, you can have a script that locally reads the file with all options and let you pick desired option locally, then it will trigger workflow_dispatch event with the selected input.
Another alternative if you don't want local parsing will be to make input as regular string and then add a step in your workflow that will read a file after actions/checkout and check if it's a valid option.
One hack could be using a second workflow (wkfl2) to maintain the workflow_dispatch (wkfl1) options. Something like the following sequence:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With