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 variable templating in the env section #111

Closed
Racer159 opened this issue Jun 3, 2024 · 0 comments · Fixed by #114
Closed

Allow variable templating in the env section #111

Racer159 opened this issue Jun 3, 2024 · 0 comments · Fixed by #114
Labels
enhancement ✨ New feature or request

Comments

@Racer159
Copy link
Contributor

Racer159 commented Jun 3, 2024

Is your feature request related to a problem? Please describe

As Ezra I want to have env var templating in the env section of a command like we currently do for dir so that I can simplify what I ask the user for and template more things into one env var.

Describe the solution you'd like

  • Given I have a cmd with an env section
  • And one of those env vars has a template string matching a variable in it (${VAR})
  • When I run Maru and set that variable
  • Then that env var is templated with the value from that variable

Describe alternatives you've considered

We could allow higher level templating of variables into other variables but this would be simpler from an implementation perspective.

Additional context

cfg.Dir = utils.TemplateString(variableConfig.GetSetVariables(), cfg.Dir)

@Racer159 Racer159 added the enhancement ✨ New feature or request label Jun 3, 2024
Racer159 added a commit that referenced this issue Jun 6, 2024
## Description

This allows templating of env vars in actions.

## Related Issue

Fixes #111 

## Type of change

- [ ] Bug fix (non-breaking change which fixes an issue)
- [X] New feature (non-breaking change which adds functionality)
- [ ] Other (security config, docs update, etc)

## Checklist before merging

- [X] Test, docs, adr added or updated as needed
- [X] [Contributor Guide
Steps](https://github.com/defenseunicorns/maru-runner/blob/main/CONTRIBUTING.md)
followed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement ✨ New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant