diff --git a/src/runboat/github.py b/src/runboat/github.py index 96aca42..b34c3e6 100644 --- a/src/runboat/github.py +++ b/src/runboat/github.py @@ -2,7 +2,7 @@ from enum import Enum from typing import Any, Optional import httpx -from pydantic import BaseModel +from pydantic import BaseModel, validator from .exceptions import NotFoundOnGitHub from .settings import settings @@ -29,6 +29,11 @@ class CommitInfo(BaseModel): pr: Optional[int] git_commit: str + @validator("repo") + @classmethod + def validate_repo(cls, v: str) -> str: + return v.lower() + async def get_branch_info(repo: str, branch: str) -> CommitInfo: branch_data = await _github_request("GET", f"/repos/{repo}/git/ref/heads/{branch}")