From 2b7dd52cef643ce20bca0cff2512f5e5aed94a06 Mon Sep 17 00:00:00 2001 From: Pierre Colson Date: Wed, 21 May 2025 10:06:44 +0200 Subject: [PATCH] feat(api): pipeline inputs support (#3194) --- gitlab/v4/objects/projects.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/gitlab/v4/objects/projects.py b/gitlab/v4/objects/projects.py index 0eaceb5a6..b415a8b98 100644 --- a/gitlab/v4/objects/projects.py +++ b/gitlab/v4/objects/projects.py @@ -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. @@ -439,6 +440,7 @@ 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: @@ -446,8 +448,14 @@ def trigger_pipeline( 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)