Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: Prompt Step type #953

Open
alex-way opened this issue Mar 20, 2024 · 3 comments · May be fixed by #978
Open

Feature: Prompt Step type #953

alex-way opened this issue Mar 20, 2024 · 3 comments · May be fixed by #978

Comments

@alex-way
Copy link
Contributor

I think it could be useful to have a Prompt step type, which sets the value to a specified variable.

The main use case I'm thinking of is a confirmation prompt, likely when doing something dangerous. For example, rm -rf <dir>.

There could also be appetite to also allow free text input, or allow the user to select a value from a defined list.

Appreciate this could totally be out of scope though.

@dbanty
Copy link
Member

dbanty commented Mar 20, 2024

We're using inquire for built-in prompts (things like asking for tokens and building changesets). We could definitely expose some of those types through new steps. It's probably best to only add things as folks need them so we don't have to worry about designing things before necessary. So, for this use-case, maybe we add a Confirm step which builds an inquire::Confirm? Would you want a custom message, or should we start with a generic default, like "Continue?" or something.

Also, particularly for confirm, would you also want a command-line option that auto-confirms? So if you run something like knope workflow-that-needs-confirmation -y it doesn't prompt.

@alex-way
Copy link
Contributor Author

I think that would work perfectly, I wonder whether it should be a separate step or whether it should just be an additional argument within the workflow?:

[[workflows.steps]]
type = "Command"
command = "git switch -c release"
confirm = true

@dbanty
Copy link
Member

dbanty commented Mar 22, 2024

Probably better to make it a standalone step, so folks can confirm before doing other built-in steps. Like, confirm before creating a pull request or a GitHub release.

@alex-way alex-way linked a pull request Mar 28, 2024 that will close this issue
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants