Skip to content

Commit 419ab84

Browse files
committed
Introduce logic for optional variables.
This will ensure variables marked as "Optional" are not checked in step "Check for required secrets"
1 parent b6f062a commit 419ab84

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

templates/source-repo/build-and-update-gitops.yml.njk

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,12 +57,14 @@ jobs:
5757
const vars = {
5858
IMAGE_REGISTRY: `${{ "vars.IMAGE_REGISTRY" | inCurlies }}`,
5959
{% for var in build_variables %}
60-
{%- if var | eval_if_condition %}
61-
{%- if var.comment %}
60+
{%- if var | eval_if_condition %}
61+
{%- if not var.optional %}
62+
{%- if var.comment %}
6263
/* {{ var.comment }} */
6364
{%- endif %}
6465
{% if var.commented_out %}/* {% endif %}{{ var.name }}: `${{ ("vars." + var.name) | inCurlies }}`,{% if var.commented_out %} */{% endif %}
65-
{%- endif %}
66+
{%- endif %}
67+
{%- endif %}
6668
{%- endfor %}
6769
};
6870

0 commit comments

Comments
 (0)