zuul-jobs/roles/markdownlint/tasks/main.yaml
Clint Byrum 33580f22b0 Add a markdownlint job and role
This tool will ensure that your markdown files follow some best
practices.

Change-Id: I7bcc70443dbe5fa31e3cc1139d608834c00851b9
2020-01-27 12:23:24 +00:00

17 lines
456 B
YAML

- name: find all .md files
find:
paths: "{{ zuul_work_dir }}"
pattern: "*.md"
register: markdown_find
- name: Run markdownlint
shell: |
set -o pipefail
set -e
~/.markdownlint/node_modules/.bin/markdownlint {{ item|relpath(zuul_work_dir) }} 2>&1 | tee -a markdownlint.txt
args:
chdir: "{{ zuul_work_dir }}"
executable: /bin/bash
with_items: "{{ markdown_find.files|map(attribute='path')|list }}"
changed_when: false