semantic_release.hvcs.gitlab module#

Helper code for interacting with a Gitlab remote VCS

class semantic_release.hvcs.gitlab.Gitlab(remote_url: str, *, hvcs_domain: str | None = None, token: str | None = None, allow_insecure: bool = False, **kwargs: Any)[source]#

Bases: RemoteHvcsBase

Gitlab HVCS interface for interacting with Gitlab repositories

DEFAULT_DOMAIN = 'gitlab.com'#
DEFAULT_ENV_TOKEN_NAME = 'GITLAB_TOKEN'#
commit_hash_url(commit_hash: str) str[source]#
compare_url(from_rev: str, to_rev: str) str[source]#
create_or_update_release(tag: str, release_notes: str, prerelease: bool = False) str[source]#

Create or update a release for the given tag in a remote VCS, attaching the given changelog, if supported

create_release(tag: str, release_notes: str, prerelease: bool = False, assets: list[str] | None = None) str[source]#

Post release changelog :param tag: Tag to create release for :param release_notes: The release notes for this version :param prerelease: This parameter has no effect :return: The tag of the release

edit_release_notes(release_id: str, release_notes: str) str[source]#
get_changelog_context_filters() tuple[Callable[..., Any], ...][source]#

Return a list of functions that can be used as filters in a Jinja2 template

ex. filters to convert text to URLs for issues and commits

issue_url(issue_number: str | int) str[source]#
merge_request_url(mr_number: str | int) str[source]#
pull_request_url(pr_number: str | int) str[source]#
remote_url(use_token: bool = True) str[source]#

Get the remote url including the token for authentication if requested

upload_dists(tag: str, dist_glob: str) int[source]#

Upload built distributions to a release on a remote VCS that supports such uploads