Skip to content

Commit cdaf69e

Browse files
committed
chore: changelog for #2069
1 parent d6234af commit cdaf69e

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
experiments (similar to `.env`) (#1982 by @vmaerten).
2828
- Added new [Getting Started docs](https://taskfile.dev/getting-started) (#2086
2929
by @pd93).
30+
- Allow `matrix` to use references to other variables (#2065, #2069 by @pd93).
3031

3132
#### Package API
3233

website/docs/usage.mdx

+21
Original file line numberDiff line numberDiff line change
@@ -1412,6 +1412,27 @@ darwin/amd64
14121412
darwin/arm64
14131413
```
14141414

1415+
You can also use references to other variables as long as they are also lists:
1416+
1417+
```yaml
1418+
version: "3"
1419+
1420+
vars:
1421+
OS_VAR: ["windows", "linux", "darwin"]
1422+
ARCH_VAR: ["amd64", "arm64"]
1423+
1424+
tasks:
1425+
default:
1426+
cmds:
1427+
- for:
1428+
matrix:
1429+
OS:
1430+
ref: .OS_VAR
1431+
ARCH:
1432+
ref: .ARCH_VAR
1433+
cmd: echo "{{.ITEM.OS}}/{{.ITEM.ARCH}}"
1434+
```
1435+
14151436
### Looping over your task's sources
14161437

14171438
You are also able to loop over the sources of your task:

0 commit comments

Comments
 (0)