Earlier today, we ran into an unpleasant problem caused by the following shell message:
- name: get remote branches
shell: git ls-remote -h git@bitbucket.org:orga/repo.git | sed 's_.*refs/heads/__g'
register: branches_remote
The command git
failed, but the return code of the entire channel is 0. This is the default behavior of bash / sh .
To fix this, in sh / bash you can set -o pipefail
or set -e
. Is it possible to do this in the inaccessible, preferably globally for all my teams shell
?
source
share