From 10d0cf656b28973711f08359a1930fe480e8d256 Mon Sep 17 00:00:00 2001 From: Matthias Dellweg Date: Thu, 14 Dec 2023 15:03:43 +0100 Subject: [PATCH] Fix a dependency on a non existing job When you configured your plugin template to not check commit messages, there's no way you can depend on that job. [noissue] --- templates/github/.github/workflows/build.yml.j2 | 3 --- templates/github/.github/workflows/ci.yml.j2 | 5 +++++ templates/github/.github/workflows/lint.yml.j2 | 3 --- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/templates/github/.github/workflows/build.yml.j2 b/templates/github/.github/workflows/build.yml.j2 index 421de339..ee14abed 100644 --- a/templates/github/.github/workflows/build.yml.j2 +++ b/templates/github/.github/workflows/build.yml.j2 @@ -16,9 +16,6 @@ defaults: jobs: build: runs-on: "ubuntu-latest" - {%- if pre_job_template %} - needs: "{{ pre_job_template.name }}" - {%- endif %} steps: {{ checkout(path=plugin_name) | indent(6) }} diff --git a/templates/github/.github/workflows/ci.yml.j2 b/templates/github/.github/workflows/ci.yml.j2 index 6ebc810a..e5a44af6 100644 --- a/templates/github/.github/workflows/ci.yml.j2 +++ b/templates/github/.github/workflows/ci.yml.j2 @@ -44,6 +44,9 @@ jobs: {%- endif %} lint: + {%- if pre_job_template %} + needs: {{ pre_job_template.name }} + {%- endif %} uses: "./.github/workflows/lint.yml" build: @@ -79,7 +82,9 @@ jobs: # This is a dummy dependent task to have a single entry for the branch protection rules. runs-on: "ubuntu-latest" needs: + {%- if check_commit_message or lint_requirements %} - "check-commits" + {%- endif %} - "lint" - "test" if: "always()" diff --git a/templates/github/.github/workflows/lint.yml.j2 b/templates/github/.github/workflows/lint.yml.j2 index 6069aeb7..6b0ab75e 100644 --- a/templates/github/.github/workflows/lint.yml.j2 +++ b/templates/github/.github/workflows/lint.yml.j2 @@ -16,9 +16,6 @@ defaults: jobs: lint: runs-on: ubuntu-latest - {%- if pre_job_template %} - needs: {{ pre_job_template.name }} - {%- endif %} steps: {{ checkout(path=plugin_name) | indent(6) }}