From 29c89a640ea4d87032a51a44f0a9325e5f5c64a2 Mon Sep 17 00:00:00 2001 From: Michael Delva Date: Fri, 26 Jun 2026 13:20:24 +0200 Subject: [PATCH 1/2] Added option to output tasks before the checkout of the project --- src/generator/features/git.py | 6 +++++- src/generator/templates/git.mako | 4 ++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/generator/features/git.py b/src/generator/features/git.py index f9b5db5..885c9e8 100644 --- a/src/generator/features/git.py +++ b/src/generator/features/git.py @@ -1,7 +1,7 @@ """This module defines the Git-related features and configurations for Jenkins pipelines.""" from abc import ABC -from typing import Any, Dict, Optional, Type +from typing import Any, Dict, List, Optional, Type from pydantic import BaseModel, Field, field_validator @@ -102,6 +102,10 @@ class GitConfig(FeatureConfig): default=None, description="The checkout configuration. If use_simple_checkout is true, this will be ignored.", ) + pre_checkout_tasks: Optional[List[str]] = Field( + default=[], + description="List of tasks to run before running the checkout.", + ) retry_count: Optional[int] = Field( default=1, description=( diff --git a/src/generator/templates/git.mako b/src/generator/templates/git.mako index 329b117..3f02a94 100644 --- a/src/generator/templates/git.mako +++ b/src/generator/templates/git.mako @@ -2,6 +2,10 @@ <%def name="additional_functions()"> def projectCheckout() { +% for pre_task in feature_config.pre_checkout_tasks: + ${pre_task} +% endfor + % if feature_config.retry_count > 1: retry(count: ${feature_config.retry_count}) { % endif From f2d67fd44708e3a1b6bce3779bf0ede488512426 Mon Sep 17 00:00:00 2001 From: Michael Delva Date: Fri, 26 Jun 2026 13:22:05 +0200 Subject: [PATCH 2/2] Added towncrier entry --- .changelog/41.added.srt | 1 + 1 file changed, 1 insertion(+) create mode 100644 .changelog/41.added.srt diff --git a/.changelog/41.added.srt b/.changelog/41.added.srt new file mode 100644 index 0000000..cb81414 --- /dev/null +++ b/.changelog/41.added.srt @@ -0,0 +1 @@ +Added pre checkout steps to the git feature \ No newline at end of file