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

"includes" path does not resolve {{.HOME}} variable #670

Closed
piotrkardasz opened this issue Feb 13, 2022 · 2 comments
Closed

"includes" path does not resolve {{.HOME}} variable #670

piotrkardasz opened this issue Feb 13, 2022 · 2 comments
Labels
area: variables Changes related to variables. state: wontfix The issue will not be progressed or fixed.

Comments

@piotrkardasz
Copy link

  • Task version: v3.10.0
  • Operating System: Ubuntu

Example Taskfile showing the issue

version: '3'

includes:
  action:
    taskfile: "{{.HOME}}/common/Taskfile.yml"

I would like to include Taskfile from the home folder but I am getting an error

stat /common/Taskfile.yml: no such file or directory

When I put taskfile: "/home/username/common/Taskfile.yml" it working correctly it looks like a .HOME and variables are not resolved in this case

@kerma kerma added the area: variables Changes related to variables. label Mar 22, 2022
@ghostsquad
Copy link
Contributor

It looks like variables are not evaluated prior to finding includes. I think this is also by design in v3 in order to avoid confusing behavior. There aren't very well defined "rules" for how/when variables are evaluated.

You may be able to try taskfile: ~/common/Taskfile.yml instead.

To be honest, it feels a bit weird to include a taskfile from your home directory... whats in that common taskfile? why isn't this checked into your source code repository?

This might actually be a symptom of not allowing the use of remote includes. This has been asked for here: #556 #380

Let me know if I'm on the right track or not regarding the "root cause" of what you are trying to accomplish.

@ghostsquad ghostsquad added the type: question Further information is requested. label Apr 6, 2022
@andreynering
Copy link
Member

Hi @piotrkardasz,

I'd say that's not officially supported. Most of the time the Taskfiles you are going to import are all on your repository (in subdirectories). I don't have plans to address use cases like this.

I hope you understand 🙂

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. state: wontfix The issue will not be progressed or fixed.
Projects
None yet
Development

No branches or pull requests

4 participants