Skip to content

feat(api): pipeline inputs support (#3194) #3206

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 7, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion gitlab/v4/objects/projects.py
Original file line number Diff line number Diff line change
Expand Up @@ -429,6 +429,7 @@ def trigger_pipeline(
ref: str,
token: str,
variables: dict[str, Any] | None = None,
inputs: dict[str, Any] | None = None,
**kwargs: Any,
) -> ProjectPipeline:
"""Trigger a CI build.
Expand All @@ -439,15 +440,22 @@ def trigger_pipeline(
ref: Commit to build; can be a branch name or a tag
token: The trigger token
variables: Variables passed to the build script
inputs: Inputs passed to the build script
**kwargs: Extra options to send to the server (e.g. sudo)

Raises:
GitlabAuthenticationError: If authentication is not correct
GitlabCreateError: If the server failed to perform the request
"""
variables = variables or {}
inputs = inputs or {}
path = f"/projects/{self.encoded_id}/trigger/pipeline"
post_data = {"ref": ref, "token": token, "variables": variables}
post_data = {
"ref": ref,
"token": token,
"variables": variables,
"inputs": inputs,
}
attrs = self.manager.gitlab.http_post(path, post_data=post_data, **kwargs)
if TYPE_CHECKING:
assert isinstance(attrs, dict)
Expand Down