task icon indicating copy to clipboard operation
task copied to clipboard

Multiple prompts

Open MalteMagnussen opened this issue 1 year ago • 3 comments

I'd love to be able to give "prompt" an array of prompts.

We have a task that releases to production. Right now we have one prompt that contains multiple questions and checks for the user.

I'd like to split those questions into multiple.

So instead of

version: '3'
tasks:
  deploy:production:
    desc: Release to prod
    prompt: "Do you wish to release to version {{.RELEASE_VERSION}}? Have you remembered to log into harbor today? Have you announced the release on Slack and aligned with team Foo?"

I'd like to do this

version: '3'
tasks:
  deploy:production:
    desc: Release to prod
    prompt:
    - Do you wish to release to version {{.RELEASE_VERSION}}? 
    - Have you remembered to log into harbor today? 
    - Have you announced the release on Slack? 
    - Have you aligned with team Foo? 

MalteMagnussen avatar Oct 10 '24 11:10 MalteMagnussen

@andreynering I want to contribute to this issue! What do you believe is the best way to go?

  1. Prompt can be a single string or multiple values
  2. Prompt for one value and prompts for multiple values?

mfbmina avatar Oct 16 '24 19:10 mfbmina

Hi @mfbmina,

Contributions are welcome!

Option 1 would better align with our current conventions. Allow a single string or an array of strings on prompt:.

andreynering avatar Oct 16 '24 19:10 andreynering

Hey @andreynering!

When you're free, could you look at the PR above?

Thanks 😄

mfbmina avatar Oct 16 '24 23:10 mfbmina