blob: f8b9f38fdb1b53110824c5a177480e6325e14293 [file] [log] [blame]
- 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 }}'