zuul-jobs/roles/golangci-lint/tasks/main.yaml
Albin Vass fff6843da0 go: Use 'block: ... always: ...' and failed_when instead of ignore_errors
Change-Id: I11fc6ec69eda00f4ac824f27712acc82ec445f79
2020-04-28 16:20:20 +02:00

24 lines
701 B
YAML

- block:
- name: Run golangci-lint
command: "golangci-lint run {{ golangci_lint_options }}"
args:
chdir: "{{ zuul_work_dir }}"
environment:
PATH: "{{ ansible_env.PATH }}:{{ go_bin_path }}"
register: _golangci_lint
always:
- name: Look for output
golangci_lint_parse_output:
workdir: '{{ zuul_work_dir }}'
output: '{{ _golangci_lint.stdout }}'
register: _golangci_lint_parse_output
- name: Return file comments to Zuul
when: _golangci_lint_parse_output.comments
delegate_to: localhost
zuul_return:
data:
zuul:
file_comments: '{{ _golangci_lint_parse_output.comments }}'