From b2f4ad5abd8daaa0e1578bd8f3d2792683cb05c3 Mon Sep 17 00:00:00 2001 From: Robert de Bock Date: Thu, 9 Nov 2023 10:05:50 +0100 Subject: [PATCH] Fixing things. --- defaults/main.yml | 2 +- generate.yml | 4 ++-- templates/README.md.j2 | 6 ++++-- files/bug_report.md => templates/bug_report.md.j2 | 7 ++++--- 4 files changed, 11 insertions(+), 8 deletions(-) rename files/bug_report.md => templates/bug_report.md.j2 (80%) diff --git a/defaults/main.yml b/defaults/main.yml index 27edaa6..84bbb9d 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -27,7 +27,7 @@ gitlab_container: "robertdebock/github-action-molecule:6.0.0" molecule_action: "robertdebock/molecule-action@6.0.0" # Would you like to add a sponsor message? -sponsor message: yes +sponsored_message: yes # A custom message can be placed with this content. custom_message: "Also see a [full explanation and example](https://robertdebock.nl/how-to-use-these-roles.html) on how to use these roles." diff --git a/generate.yml b/generate.yml index 545939c..da3098e 100755 --- a/generate.yml +++ b/generate.yml @@ -112,8 +112,6 @@ dest: "{{ role_path }}/{{ item.dest | default(item.source) }}" mode: "{{ item.mode | default('0644') }}" with_items: - - source: bug_report.md - dest: .github/ISSUE_TEMPLATE/bug_report.md - source: feature_request.md dest: .github/ISSUE_TEMPLATE/feature_request.md - source: gitignore @@ -156,6 +154,8 @@ dest: .github/workflows/requirements2png.yml - source: FUNDING.yml dest: .github/FUNDING.yml + - source: bug_report.md + dest: .github/ISSUE_TEMPLATE/bug_report.md loop_control: label: "{{ item.source }}" diff --git a/templates/README.md.j2 b/templates/README.md.j2 index 21aa4bc..4d599a5 100644 --- a/templates/README.md.j2 +++ b/templates/README.md.j2 @@ -20,7 +20,9 @@ The machine needs to be prepared. In CI this is done using [`molecule/default/pr {{ prepare.content | b64decode | regex_replace('ansible-role-', galaxy_namespace ~ '.') }}``` {% endif %} -{% custom_message %} +{% if custom_message is defined %} +{{ custom_message }} +{% endif %} {% if variables.content is defined %} ## [Role Variables](#role-variables) @@ -90,6 +92,6 @@ If you find issues, please register them in [GitHub](https://github.com/{{ githu [{{ meta.galaxy_info.author }}]({{ author_website }}) -{% if sponsor_message %} +{% if sponsored_message %} Please consider [sponsoring me](https://github.com/sponsors/{{ github_namespace }}). {% endif %} diff --git a/files/bug_report.md b/templates/bug_report.md.j2 similarity index 80% rename from files/bug_report.md rename to templates/bug_report.md.j2 index 4bb9d98..54e3a82 100644 --- a/files/bug_report.md +++ b/templates/bug_report.md.j2 @@ -4,7 +4,7 @@ about: Create a report to help me improve --- -## Describe the bug +# Describe the bug A clear and concise description of what the bug is. @@ -13,7 +13,6 @@ A clear and concise description of what the bug is. Please paste the playbook you are using. (Consider `requirements.yml` and optionally the command you've invoked.) - ```yaml --- YOUR PLAYBOOK HERE @@ -29,4 +28,6 @@ Show at least the error, possible related output, maybe just all the output. - Control node Ansible version: [e.g. 2.9.1] (`ansible --version`) - Managed node OS: [e.g. CentOS 7] (`cat /etc/os-release`) -Please consider [sponsoring me](https://github.com/sponsors/robertdebock). +{% if sponsored_message %} +Please consider [sponsoring me](https://github.com/sponsors/{{ github_namespace }}). +{% endif %}