-
-
Notifications
You must be signed in to change notification settings - Fork 625
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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
- Loading branch information
Showing
4 changed files
with
21 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 4 additions & 0 deletions
4
testdata/includes_interpolation/include_with_env_variable/Taskfile.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
version: "3" | ||
|
||
includes: | ||
include-with-env-variable: '../{{.MODULE}}/Taskfile.yml' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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://[email protected]/my-org/my-repo/main/Taskfile.yml` | ||
|
||
## Security | ||
|
||
Running commands from sources that you do not control is always a potential | ||
|