|
|
@@ -85,6 +85,7 @@ class Context(SimpleNamespace):
|
|
|
"""Wrapper class for the context of the CI runtime"""
|
|
|
|
|
|
def __call__(self, arg: Value | None) -> Scalar | None:
|
|
|
+ """Accessor for context state with a dot-separated path"""
|
|
|
if arg is None:
|
|
|
return None
|
|
|
|
|
|
@@ -94,13 +95,13 @@ class Context(SimpleNamespace):
|
|
|
if not isinstance(arg, Ref):
|
|
|
return arg
|
|
|
|
|
|
- """Accessor for context state with a dot-separated path"""
|
|
|
if arg.path[0] == "env":
|
|
|
assert len(arg.path) == 2
|
|
|
return os.environ.get(arg.path[1])
|
|
|
|
|
|
- attr = lambda o, a: o[a] if isinstance(o, dict) else getattr(o, a)
|
|
|
- return reduce(attr, arg.path, self) # type: ignore[return-value]
|
|
|
+ return reduce( # type: ignore[return-value]
|
|
|
+ lambda o, a: o[a] if isinstance(o, dict) else getattr(o, a), arg.path, self
|
|
|
+ )
|
|
|
|
|
|
@overload
|
|
|
def fabricate(
|