From 558c4a613fb0c89f0f5b6bb20ba0f630d3b3cad8 Mon Sep 17 00:00:00 2001 From: Mohammed Naser Date: Wed, 24 Jul 2024 15:46:06 -0400 Subject: [PATCH] Add check for README + add missing README --- roles/portworx/README.md | 1 + zuul.d/playbooks/build-collection/pre.yml | 22 ++++++++++++++++++++++ 2 files changed, 23 insertions(+) create mode 100644 roles/portworx/README.md diff --git a/roles/portworx/README.md b/roles/portworx/README.md new file mode 100644 index 000000000..f456a3dda --- /dev/null +++ b/roles/portworx/README.md @@ -0,0 +1 @@ +# `portworx` diff --git a/zuul.d/playbooks/build-collection/pre.yml b/zuul.d/playbooks/build-collection/pre.yml index a9e076c57..fca4d62ab 100644 --- a/zuul.d/playbooks/build-collection/pre.yml +++ b/zuul.d/playbooks/build-collection/pre.yml @@ -18,6 +18,28 @@ - name: Prepare for collection build hosts: all tasks: + - name: Find all roles + find: + paths: "{{ zuul.project.src_dir }}/roles/" + file_type: directory + register: role_dirs + + - name: Check for README.md in each role + stat: + path: "{{ item.path }}/README.md" + register: readme_check + loop: "{{ role_dirs.files }}" + loop_control: + label: "{{ item.path }}" + + - name: Fail if any role is missing README.md + fail: + msg: "Missing README.md in role {{ item.item.path }}" + when: not item.stat.exists + loop: "{{ readme_check.results }}" + loop_control: + label: "{{ item.item.path }}" + - name: Pin all image digests ansible.builtin.include_role: name: tox