ignore_error: true attribute to ignore errors during task execution. This allows subsequent tasks and commands to continue running even if the task fails.
Taskfile.yaml
Demo and Output
Allow subsequent commands and tasks to continue running even when a task fails using ignore_error.
ignore_error: true attribute to ignore errors during task execution. This allows subsequent tasks and commands to continue running even if the task fails.
version: '3'
tasks:
lint:
internal: true
ignore_error: true
cmds:
- exit 1
deploy:
cmds:
- task: lint
- echo "This will run even if lint fails"
ubuntu@touted-mite:~$ task deploy
task: [lint] exit 1
task: [deploy] echo "This will run even if lint fails"
This will run even if lint fails
ignore_error carefully. Silently ignoring errors can make failures harder to detect. It is best used for non-critical tasks like linters where you want the pipeline to continue regardless.