GitRelease
- class github.GitRelease.GitRelease
This class represents GitReleases.
The reference can be found here https://docs.github.com/en/rest/reference/repos#releases
The OpenAPI schema can be found at
/components/schemas/release
A CompletableGithubObject can be partially initialised (completed=False). Accessing attributes that are not initialized will then trigger a request to complete all attributes.
A partially initialized CompletableGithubObject (completed=False) can be completed via
complete(). This requires the url to be given via parameterurlorattributes.With a requester where
Requester.is_lazy == True, this CompletableGithubObjects is partially initialized. This requires the url to be given via parameterurlorattributes. Any CompletableGithubObject created from this lazy object will be lazy itself if created with parameterurlorattributes.- Parameters:
requester – requester
headers – response headers
attributes – attributes to initialize
completed – do not update non-initialized attributes when True
url – url of this instance, overrides attributes[‘url’]
accept – use this accept header when completing this instance
- delete_release() None
- update_release(name: str, message: str, draft: bool = False, prerelease: bool = False, tag_name: str | _NotSetType = NotSet, target_commitish: str | _NotSetType = NotSet, make_latest: str | _NotSetType = NotSet, discussion_category_name: str | _NotSetType = NotSet) GitRelease
- upload_asset(path: str, label: str = '', content_type: Opt[str] = NotSet, name: Opt[str] = NotSet) GitReleaseAsset
- upload_asset_from_memory(file_like: BinaryIO, file_size: int, name: str, content_type: Opt[str] = NotSet, label: str = '') GitReleaseAsset
Uploads an asset.
Unlike
upload_asset()this method allows you to pass in a file-like object to upload. Note that this method is more strict and requires you to specify thename, since there’s no file name to infer these from. :calls: POST /repos/{owner}/{repo}/releases/{release_id}/assets :param file_like: binary file-like object, such as those returned byopen("file_name", "rb"). At the very minimum, this object must implementread(). :param file_size: int, size in bytes offile_like
- get_assets() PaginatedList[GitReleaseAsset]