Skip to content

Commit 39568ba

Browse files
committed
Combine secret/env normalization in single validator
1 parent 5bcc84c commit 39568ba

1 file changed

Lines changed: 1 addition & 10 deletions

File tree

src/openhound_github/models/workflow.py

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ class WorkflowJobDefinition(BaseModel):
108108
# additionally, to prevent other yaml parsing issues, make sure we always convert the key/value to string first
109109
# for both env and secrets
110110

111-
@field_validator("env", mode="before")
111+
@field_validator("env", "secrets", mode="before")
112112
@classmethod
113113
def dict_or_empty(cls, value: Any) -> dict[str, str]:
114114
return (
@@ -117,15 +117,6 @@ def dict_or_empty(cls, value: Any) -> dict[str, str]:
117117
else {}
118118
)
119119

120-
@field_validator("secrets", mode="before")
121-
@classmethod
122-
def secrets_or_empty(cls, value: Any) -> dict[str, str]:
123-
return (
124-
{f"{str(key)}": f"{str(value)}" for key, value in value.items()}
125-
if isinstance(value, dict)
126-
else {}
127-
)
128-
129120
@field_validator("steps", mode="before")
130121
@classmethod
131122
def valid_step_dicts(cls, value: Any) -> list[dict[str, Any]]:

0 commit comments

Comments
 (0)