mirror of
https://github.com/saltstack/salt.git
synced 2025-04-16 01:30:20 +00:00
Make jinja rendering strict. Undefined variable use throws error.
This commit is contained in:
parent
78625d8db7
commit
5c4e810836
3 changed files with 5 additions and 2 deletions
|
@ -17,7 +17,7 @@
|
|||
relenv-version: "<{ relenv_version }>"
|
||||
python-version: "<{ python_version }>"
|
||||
source: "<{ backend }>"
|
||||
<%- if gh_environment %>
|
||||
<%- if gh_environment != "ci" %>
|
||||
environment: <{ gh_environment }>
|
||||
sign-macos-packages: true
|
||||
sign-windows-packages: <% if gh_environment == 'nightly' -%> false <%- else -%> ${{ inputs.sign-windows-packages }} <%- endif %>
|
||||
|
|
2
.github/workflows/templates/ci.yml.jinja
vendored
2
.github/workflows/templates/ci.yml.jinja
vendored
|
@ -1,3 +1,5 @@
|
|||
<%- set gh_environment = gh_environment|default("ci") %>
|
||||
|
||||
<%- extends 'layout.yml.jinja' %>
|
||||
<%- set pre_commit_version = "3.0.4" %>
|
||||
|
||||
|
|
|
@ -11,7 +11,7 @@ import shutil
|
|||
from typing import TYPE_CHECKING, cast
|
||||
|
||||
import yaml
|
||||
from jinja2 import Environment, FileSystemLoader
|
||||
from jinja2 import Environment, FileSystemLoader, StrictUndefined
|
||||
from ptscripts import Context, command_group
|
||||
|
||||
import tools.utils
|
||||
|
@ -292,6 +292,7 @@ def generate_workflows(ctx: Context):
|
|||
"jinja2.ext.do",
|
||||
],
|
||||
loader=FileSystemLoader(str(TEMPLATES)),
|
||||
undefined=StrictUndefined,
|
||||
)
|
||||
for workflow_name, details in workflows.items():
|
||||
if TYPE_CHECKING:
|
||||
|
|
Loading…
Add table
Reference in a new issue