diff --git a/src/GitlabCli/Pipelines.psm1 b/src/GitlabCli/Pipelines.psm1 index de84535..c1815e2 100644 --- a/src/GitlabCli/Pipelines.psm1 +++ b/src/GitlabCli/Pipelines.psm1 @@ -706,6 +706,10 @@ function New-GitlabPipeline { [string] $Ref = '.', + [Parameter(Mandatory=$false)] + [System.Object[]] + $Variables, + [Parameter(Mandatory=$false)] [switch] $Wait, @@ -734,10 +738,16 @@ function New-GitlabPipeline { $Ref = $Project.DefaultBranch } + $RequestBody = @{'ref' = $Ref} + + if($Variables) { + $RequestBody.Add("variables",$Variables) + } + $GitlabApiArguments = @{ HttpMethod = "POST" Path = "projects/$ProjectId/pipeline" - Query = @{'ref' = $Ref} + Body = $RequestBody SiteUrl = $SiteUrl }