Skip to content

Commit

Permalink
fix: 修复发布流程检测判定与流程
Browse files Browse the repository at this point in the history
  • Loading branch information
BigOrangeQWQ committed Sep 9, 2024
1 parent ec40040 commit 4110fed
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/plugins/publish/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ async def check_rule(
event: IssuesOpened | IssuesReopened | IssuesEdited | IssueCommentCreated,
publish_type: PublishType | None = Depends(get_type_by_labels),
) -> bool:
logger.info(f"评论来自: {event.payload.model_dump()}")
logger.info(f"评论来自: {event.model_dump()}")
if (
isinstance(event, IssueCommentCreated)
and event.payload.comment.user
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/publish/validation.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def strip_ansi(text: str | None) -> str:
async def validate_plugin_info_from_issue(issue: "Issue") -> ValidationDict:
"""从议题中获取插件信息,并且运行插件测试加载且获取插件元信息后进行验证"""
body = issue.body if issue.body else ""
author = issue.user.id if issue.user else ""
author = issue.user.login if issue.user else ""
author_id = issue.user.id if issue.user else None

# 从议题里提取插件所需信息
Expand Down
5 changes: 5 additions & 0 deletions src/utils/validation/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,11 @@ class ValidationDict(BaseModel):
def data_validator(cls, v: dict[str, Any] | BaseModel) -> dict[str, Any]:
if isinstance(v, BaseModel):
return v.model_dump()
elif isinstance(v, dict):
return {
key: value.model_dump() if isinstance(value, BaseModel) else value
for key, value in v.items()
}
return v


Expand Down

0 comments on commit 4110fed

Please sign in to comment.