Be more explicit about using Jinja for templates

Signed-off-by: Pedro Algarvio <palgarvio@vmware.com>
This commit is contained in:
Pedro Algarvio 2023-02-08 06:50:46 +00:00 committed by Pedro Algarvio
parent 3fa827925f
commit 292248f812
9 changed files with 8 additions and 8 deletions

View file

@ -1,5 +1,5 @@
# Do not edit these workflows directly as the changes made will be overwritten.
# Instead, edit the template '.github/workflows/templates/ci.yml.j2'
# Instead, edit the template '.github/workflows/templates/ci.yml.jinja'
---
name: CI
on:

View file

@ -1,5 +1,5 @@
# Do not edit these workflows directly as the changes made will be overwritten.
# Instead, edit the template '.github/workflows/templates/nightly.yml.j2'
# Instead, edit the template '.github/workflows/templates/nightly.yml.jinja'
---
name: Nightly

View file

@ -1,5 +1,5 @@
# Do not edit these workflows directly as the changes made will be overwritten.
# Instead, edit the template '.github/workflows/templates/scheduled.yml.j2'
# Instead, edit the template '.github/workflows/templates/scheduled.yml.jinja'
---
name: Scheduled

View file

@ -1,4 +1,4 @@
<%- extends 'layout.yml.j2' %>
<%- extends 'layout.yml.jinja' %>
<%- set pre_commit_version = "3.0.4" %>
<%- block on %>

View file

@ -1,5 +1,5 @@
<%- set gh_environment = gh_environment|default("nightly") %>
<%- extends 'ci.yml.j2' %>
<%- extends 'ci.yml.jinja' %>
<%- block on %>

View file

@ -1,4 +1,4 @@
<%- extends 'ci.yml.j2' %>
<%- extends 'ci.yml.jinja' %>
<%- block on %>

View file

@ -79,7 +79,7 @@ def generate_workflows(ctx: Context):
template: str = cast(str, details["template"])
includes: dict[str, bool] = cast(dict, details.get("includes") or {})
workflow_path = WORKFLOWS / template
template_path = TEMPLATES / f"{template}.j2"
template_path = TEMPLATES / f"{template}.jinja"
ctx.info(
f"Generating '{workflow_path.relative_to(REPO_ROOT)}' from "
f"template '{template_path.relative_to(REPO_ROOT)}' ..."
@ -94,7 +94,7 @@ def generate_workflows(ctx: Context):
if workflow_name == "Check Workflow Run":
check_workflows = [wf for wf in sorted(workflows) if wf != workflow_name]
context["check_workflows"] = check_workflows
loaded_template = env.get_template(f"{template}.j2")
loaded_template = env.get_template(template_path.name)
rendered_template = loaded_template.render(**context)
workflow_path.write_text(rendered_template.rstrip() + "\n")