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

Better support for non-interactive execution? #17

Open
loreanvictor opened this issue Jul 17, 2023 · 0 comments
Open

Better support for non-interactive execution? #17

loreanvictor opened this issue Jul 17, 2023 · 0 comments
Labels
enhancement New feature or request question Further information is requested

Comments

@loreanvictor
Copy link
Owner

Interactive recipes can't be executed in automated workflows. There should be a way for the recipe to know if it is being executed non-interactively, and act accordingly. Now this is crudely possible already by using environment variables, i.e.

NON_INTERACTIVE=true npx tmplr
if: env.NON_INTERACTIVE
steps:
  ...
else:
  steps:
    ...

But is it worth adding better support for this? For example, all interactive expressions could have a fallback property, which would be used if the environment is non-interactive (basically, the command should get an error if they try to connect to an IO interface in such an environment, falling back to their fallback). Detecting whether the environment is non-interactive can be done via multiple ways: a flag (such as --force), environment variables for popular CI/CD pipelines (see this), etc. This could also result in a predetermined environment variable being automatically set, basically standardising the env var solution outlined above.

@loreanvictor loreanvictor added enhancement New feature or request question Further information is requested labels Jul 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request question Further information is requested
Projects
None yet
Development

No branches or pull requests

1 participant