utils
Class info¶
🛈 DocStrings¶
create_asset_model
¶
create_asset_model(gh_asset: Any) -> Asset
Create Asset model from GitHub asset object.
Source code in src/githarbor/providers/github_provider/utils.py
create_branch_model
¶
create_branch_model(branch: Any) -> Branch
Create Branch model from GitHub branch object.
Source code in src/githarbor/providers/github_provider/utils.py
create_comment_model
¶
create_comment_model(gh_comment: Any) -> Comment
Create Comment model from GitHub comment object.
Source code in src/githarbor/providers/github_provider/utils.py
create_file_model
¶
Create file info dictionary from GitHub content object.
Source code in src/githarbor/providers/github_provider/utils.py
create_label_model
¶
create_label_model(gh_label: Any) -> Label
Create Label model from GitHub label object.
Source code in src/githarbor/providers/github_provider/utils.py
create_tag_model
¶
create_tag_model(tag: Any, *, name: str | None = None) -> Tag
Create Tag model from GitHub Tag, GitTag, or lightweight Commit object.
Source code in src/githarbor/providers/github_provider/utils.py
create_user_model
¶
create_user_model(gh_user: NamedUser | AuthenticatedUser) -> User
create_user_model(gh_user: NamedUser | AuthenticatedUser | None) -> User | None
Create User model from GitHub user object.
Source code in src/githarbor/providers/github_provider/utils.py
create_workflow_model
¶
create_workflow_model(workflow: Any) -> Workflow
Create Workflow model from GitHub workflow object.
Source code in src/githarbor/providers/github_provider/utils.py
create_workflow_run_model
¶
create_workflow_run_model(run: Any) -> WorkflowRun
Create WorkflowRun model from GitHub workflow run object.
Source code in src/githarbor/providers/github_provider/utils.py
handle_github_errors
¶
Decorator to handle GitHub API exceptions consistently.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
error_msg_template
|
str
|
Message template with format placeholders |
required |
Example
@handle_github_errors("Could not fetch branch {branch_name}") def get_branch(self, branch_name: str) -> Branch: ...