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

include interpolation doesn't support dynamic variables #951

Open
fatmcgav-depop opened this issue Dec 8, 2022 · 2 comments
Open

include interpolation doesn't support dynamic variables #951

fatmcgav-depop opened this issue Dec 8, 2022 · 2 comments
Labels
area: variables Changes related to variables.

Comments

@fatmcgav-depop
Copy link

Follow on from #942

We have a use-case where we would like to use "dynamic" variables as part of the path for an included Taskfile.

e.g.

---
version: "3"

vars:
  MODULE_NAME:
    sh: jq -r .module_name cookiecutter.json

includes:
  # Support running tasks defined in the generated template module
  generated:
    taskfile: './cookiecutter-temp/{{ .MODULE_NAME }}'
    dir: './cookiecutter-temp/{{ .MODULE_NAME }}'
    optional: true

Note that #943 added support for "static" variables, this ask is specifically for dynamic variable support.
Also see #942 (comment)

@github-actions github-actions bot added the state: needs triage Waiting to be triaged by a maintainer. label Dec 8, 2022
@pd93
Copy link
Member

pd93 commented Dec 8, 2022

Thanks for creating the issue. Since the current docs only mention using static variables, I'm going to categorise this as an enhancement and we can add something to the docs to explicitly say this is supported once its resolved.

@pd93 pd93 added enhancement area: variables Changes related to variables. and removed state: needs triage Waiting to be triaged by a maintainer. labels Dec 8, 2022
@iwittkau
Copy link
Contributor

This could also improve the security aspects of #1317:

vars:
  GITHOST_TOKEN:
    sh: security find-generic-password -s "Git host token" -w

includes:
  compose: https://git:{{.GITHOST_TOKEN}}@example.com/shared/taskfiles.git//Tasks.yaml?ref=main

On macOS you can store tokens in the Keychain using the security CLI.
On GNOME-based Linux distributions you can do something similar with secret-tool.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: variables Changes related to variables.
Projects
None yet
Development

No branches or pull requests

3 participants