Skip to content

Commit

Permalink
bugfix: previous release was bogus, needed to make sure variables are…
Browse files Browse the repository at this point in the history
… always a collection
  • Loading branch information
chris-peterson committed Oct 3, 2023
1 parent 61892d6 commit 79e25b6
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/GitlabCli/GitlabCli.psd1
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@{
ModuleVersion = '1.101.3'
ModuleVersion = '1.101.4'

PrivateData = @{
PSData = @{
Expand Down
2 changes: 1 addition & 1 deletion src/GitlabCli/Jobs.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ function Start-GitlabJob {
$GitlabApiArguments.Body.job_variables_attributes = $Variables | ConvertTo-GitlabVariables
}

if ($PSCmdlet.ShouldProcess("$($Project.PathWithNamespace)", "start job $($GitlabApiArguments | ConvertTo-Json)")) {
if ($PSCmdlet.ShouldProcess("$($Project.PathWithNamespace)", "start job $($GitlabApiArguments | ConvertTo-Json -Depth 3)")) {
try {
# https://docs.gitlab.com/ee/api/jobs.html#run-a-job
Invoke-GitlabApi @GitlabApiArguments | New-WrapperObject "Gitlab.Job"
Expand Down
4 changes: 3 additions & 1 deletion src/GitlabCli/Variables.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ function ConvertTo-GitlabVariables {
$VariableType
)

$GitlabVars = @()
if ($Object) {
$Enumerator = switch ($Object.GetType().Name) {
hashtable {
Expand All @@ -101,7 +102,8 @@ function ConvertTo-GitlabVariables {
if ($VariableType) {
$Var.variable_type = $VariableType
}
$Var
$GitlabVars += $Var
}
}
,$GitlabVars
}

0 comments on commit 79e25b6

Please sign in to comment.