Merge branch 'group-begin-message' of https://github.com/janslow/task into janslow-group-begin-message

This commit is contained in:
Andrey Nering
2022-02-19 18:42:34 -03:00
14 changed files with 270 additions and 36 deletions

View File

@@ -973,6 +973,33 @@ tasks:
finishes, so you won't have live feedback for commands that take a long time
to run.
When using the `group` output, you can optionally provide a templated message
to print at the start of the group. This can be useful for instructing CI
systems to group all of the output for a given task, such as with [GitHub
Actions' `::group::` command](https://docs.github.com/en/actions/learn-github-actions/workflow-commands-for-github-actions#grouping-log-lines).
```yaml
version: '3'
output:
group:
begin: '::begin::{{.TASK}}'
end: '::endgroup::'
tasks:
default:
cmds:
- echo 'Hello, World!'
silent: true
```
```bash
$ task default
::begin::default
Hello, World!
::endgroup::
```
The `prefix` output will prefix every line printed by a command with
`[task-name] ` as the prefix, but you can customize the prefix for a command
with the `prefix:` attribute: