Ensure jinjifying an artifact passes through safe_artifact_file just in case

This commit is contained in:
Miguel Jacq 2026-06-22 10:57:08 +10:00
parent 03dc467e32
commit e2b61bcdf1
Signed by: mig5
GPG key ID: 03906B4110AAD3B8

View file

@ -9,6 +9,7 @@ from dataclasses import dataclass
from pathlib import Path from pathlib import Path
from typing import Any, Dict, List, Optional, Set, Tuple from typing import Any, Dict, List, Optional, Set, Tuple
from .manifest_safety import ArtifactSafetyError, safe_artifact_file
from .yamlutil import yaml_dump_mapping, yaml_load_mapping from .yamlutil import yaml_dump_mapping, yaml_load_mapping
@ -157,8 +158,9 @@ def jinjify_artifact(
if not (jt_enabled and jt_exe and can_jinjify_path(dest_path)): if not (jt_enabled and jt_exe and can_jinjify_path(dest_path)):
return None return None
artifact_path = Path(bundle_dir) / "artifacts" / artifact_role / src_rel try:
if not artifact_path.is_file(): artifact_path = safe_artifact_file(bundle_dir, artifact_role, src_rel)
except (ArtifactSafetyError, FileNotFoundError):
return None return None
try: try: