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

Allow option to populate prompt response to sub tasks #1870

Open
onedr0p opened this issue Oct 18, 2024 · 0 comments
Open

Allow option to populate prompt response to sub tasks #1870

onedr0p opened this issue Oct 18, 2024 · 0 comments
Labels
state: needs triage Waiting to be triaged by a maintainer.

Comments

@onedr0p
Copy link
Contributor

onedr0p commented Oct 18, 2024

Current issue

---
version: '3'
tasks:
  task-1:
    prompt: Task 1?
    cmds:
      - task: task-2
  task-2:
    prompt: Task 2?
    cmd: echo hello

With the above example if I run task task-1 --yes the task-2 will not ask for a prompt and run. However if I run task task-1 and answer y I still get prompted on task-2.

It would be great if there was a way to enable passing down the prompt response to sub-tasks. I am aware of work-arounds like instead of using - task: task-2 just use - task task-2 --yes but it doesn't seem very native and defeats the purpose of having the task: option in certain cases like this. If that is actually the suggested way to do it, that's fine.

Purposed solution

---
version: '3'
tasks:
  task-1:
    prompt: Task 1?
    cmds:
      - task: task-2
        propagate:
          prompt: true
          force: true # Could also be used to propagate `--force` to sub-tasks
  task-2:
    prompt: Task 2?
    cmd: echo hello

or allow the sub task to inherit the task calling it prompt reaponse

---
version: '3'
tasks:
  task-1:
    prompt: Task 1?
    cmds:
      - task: task-2
  task-2:
    prompt: Task 2?
    cmd: echo hello
    inherit_prompt_response: true
@task-bot task-bot added the state: needs triage Waiting to be triaged by a maintainer. label Oct 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
state: needs triage Waiting to be triaged by a maintainer.
Projects
None yet
Development

No branches or pull requests

2 participants