- name: Run test_command | |
shell: | | |
OUT='{{ ansible_user_dir }}/zuul-output/logs/git-clang-format.patch' | |
git-clang-format --quiet --diff --style file 'origin/{{ zuul.branch }}' | tee "${OUT}" | |
if [[ "$(head -n 1 ${OUT})" == "no modified files to format" ]]; then | |
# no usable exit code for this... | |
rm -f "${OUT}" | |
exit 0 | |
elif [[ -s "${OUT}" ]]; then | |
# ...whereas this one exits with 0... | |
exit 1 | |
else | |
rm -f "${OUT}" | |
exit 0 | |
fi | |
args: | |
chdir: '{{ zuul.project.src_dir }}' |