mirror of
https://github.com/saltstack/salt.git
synced 2025-04-16 17:50:20 +00:00
Be more explicit about using Jinja for templates
Signed-off-by: Pedro Algarvio <palgarvio@vmware.com>
This commit is contained in:
parent
3fa827925f
commit
292248f812
9 changed files with 8 additions and 8 deletions
2
.github/workflows/ci.yml
vendored
2
.github/workflows/ci.yml
vendored
|
@ -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:
|
||||
|
|
2
.github/workflows/nightly.yml
vendored
2
.github/workflows/nightly.yml
vendored
|
@ -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
|
||||
|
||||
|
|
2
.github/workflows/scheduled.yml
vendored
2
.github/workflows/scheduled.yml
vendored
|
@ -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
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
<%- extends 'layout.yml.j2' %>
|
||||
<%- extends 'layout.yml.jinja' %>
|
||||
<%- set pre_commit_version = "3.0.4" %>
|
||||
|
||||
<%- block on %>
|
|
@ -1,5 +1,5 @@
|
|||
<%- set gh_environment = gh_environment|default("nightly") %>
|
||||
<%- extends 'ci.yml.j2' %>
|
||||
<%- extends 'ci.yml.jinja' %>
|
||||
|
||||
<%- block on %>
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
<%- extends 'ci.yml.j2' %>
|
||||
<%- extends 'ci.yml.jinja' %>
|
||||
|
||||
<%- block on %>
|
||||
|
|
@ -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")
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue