feat(remote): replace env variable in include remote URL (#1610)

* feat(remote): replace env variable in include remote URL

* use templating system instead of os.ExpandEnv

* lint
This commit is contained in:
Valentin Maerten
2024-04-29 23:27:30 +02:00
committed by GitHub
parent e23ef818ea
commit c81dbda157
4 changed files with 21 additions and 1 deletions

View File

@@ -48,6 +48,17 @@ tasks:
and you run `task my-remote-namespace:hello`, it will print the text: "Hello
from the remote Taskfile!" to your console.
URL is processed by the templating system, so you can reference environment variable in your URL to have authentication, for example :
```yaml
version: '3'
includes:
my-remote-namespace: https://{{.TOKEN}}@raw.githubusercontent.com/my-org/my-repo/main/Taskfile.yml
```
`TOKEN=my-token task my-remote-namespace:hello` will be resolved by Task to `https://my-token@raw.githubusercontent.com/my-org/my-repo/main/Taskfile.yml`
## Security
Running commands from sources that you do not control is always a potential