Jan Kundrát | fd2386f | 2019-02-27 17:41:23 +0100 | [diff] [blame^] | 1 | - name: Run test_command |
| 2 | shell: | |
| 3 | OUT='{{ ansible_user_dir }}/zuul-output/logs/git-clang-format.patch' |
| 4 | git-clang-format --quiet --diff --style file 'origin/{{ zuul.branch }}' | tee "${OUT}" |
| 5 | if [[ "$(head -n 1 ${OUT})" == "no modified files to format" ]]; then |
| 6 | # no usable exit code for this... |
| 7 | rm -f "${OUT}" |
| 8 | exit 0 |
| 9 | elif [[ -s "${OUT}" ]]; then |
| 10 | # ...whereas this one exits with 0... |
| 11 | exit 1 |
| 12 | else |
| 13 | rm -f "${OUT}" |
| 14 | exit 0 |
| 15 | fi |
| 16 | args: |
| 17 | chdir: '{{ zuul.project.src_dir }}' |