-
-
Notifications
You must be signed in to change notification settings - Fork 763
Closed as duplicate of#2440
Closed as duplicate of#2440
Copy link
Labels
area: releasingChanges related to the release process.Changes related to the release process.
Description
Description
- What I did: run task to build project. The project build failed (compilation error). Task printed 'Failed to run task "backend": exit status 2` in red.
- What I expected: exit code (
$?in bash) is non-zero. - What I got: exit code is 0.
The problem caused CI to not stop the build and erroneously continue with tests.
I have found that it is task installed via npm that always returns 0 exit code. It's easy to reproduce that, just add any command to the target that returns non-zero extit code. Then:
$ task
Failed to run task "backend": exit status 2
$ echo $?
0If installing task via apt install, the exit code is correct (201).
Minimal working example:
version: '3'
tasks:
default:
cmds:
- falseHow to reproduce:
$ npm install -g @go-task/cli
$ ~/.nvm/versions/node/v24.10.0/bin/task # full path to ensure task from npm is used
$ echo $?
0
$ /usr/bin/task
$ echo $?
201
Version
3.45.5
Operating system
Linux (Ubuntu)
Experiments Enabled
No response
Example Taskfile
version: '3'
tasks:
default:
cmds:
- falseMetadata
Metadata
Assignees
Labels
area: releasingChanges related to the release process.Changes related to the release process.