Skip to content

Allow Interactive Prompt Variables to be Fed From Shell #2647

@sashokbg

Description

@sashokbg

Description

This feature request builds on top of #2579 which is still work in progress as of time of writing.

#2579 introduces the ability to pause the execution and prompt the user to fill in any missing required variables.
The prompt can either be a simple text input or a select from a pre-defined list of enum variables.

This proposal adds the sh key to an interactive variable, allowing to provide a dynamic list of options from an arbitrary shell script.
Here are some examples of how this might be used:

tasks:
  deploy:
    requires:
      vars:
        - name: "TARGET_FILE"
          sh: "ls /home/alexander/projects"
        - name: ENVIRONMENT
          sh: 'printf "choice1\nchoice2\nchoice3'

I have already worked on this feature and successfully tested it locally in a now closed PR #2379

Thanks to @vmaerten for initiating the work, I would be happy to contribute to your PR if the proposal looks good to the maintainers.

Have a great day !
Aleks

Metadata

Metadata

Assignees

No one assigned

    Labels

    state: needs triageWaiting to be triaged by a maintainer.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions