Skip to content

Commit

Permalink
Some consistency tweaks and bump version to publish
Browse files Browse the repository at this point in the history
  • Loading branch information
chris-peterson committed Oct 19, 2023
1 parent cadafb4 commit f7cfcea
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 22 deletions.
4 changes: 2 additions & 2 deletions src/GitlabCli/GitlabCli.psd1
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
@{
ModuleVersion = '1.104.1'
ModuleVersion = '1.105.0'

PrivateData = @{
PSData = @{
LicenseUri = 'https://github.com/chris-peterson/pwsh-gitlab/blob/main/LICENSE'
ProjectUri = 'https://github.com/chris-peterson/pwsh-gitlab'
ReleaseNotes = 'Audit event tweaks'
ReleaseNotes = 'https://github.com/chris-peterson/pwsh-gitlab/pull/85'
}
}

Expand Down
35 changes: 15 additions & 20 deletions src/GitlabCli/Projects.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -396,33 +396,33 @@ function Update-GitlabProject {
[string]
$ProjectId = '.',

[Parameter(Mandatory=$false)]
[Parameter()]
[ValidateSet('private', 'internal', 'public')]
[string]
$Visibility,

[Parameter(Mandatory=$false)]
[Parameter()]
[string]
$Name,

[Parameter(Mandatory=$false)]
[Parameter()]
[string]
$Path,

[Parameter(Mandatory=$false)]
[Parameter()]
[string]
$DefaultBranch,

[Parameter(Mandatory=$false)]
[Parameter()]
[string []]
$Topics,

[Parameter(Mandatory=$false)]
[Parameter()]
[ValidateSet('fetch', 'clone')]
[string]
$BuildGitStrategy,

[Parameter(Mandatory=$false)]
[Parameter()]
[uint]
$CiDefaultGitDepth,

Expand All @@ -431,21 +431,22 @@ function Update-GitlabProject {
[object]
$CiForwardDeployment,

[Parameter(Mandatory=$false)]
[Parameter()]
[ValidateSet('disabled', 'private', 'enabled')]
[string]
$RepositoryAccessLevel,

[Parameter(Mandatory=$false)]
[Parameter()]
[ValidateSet('disabled', 'private', 'enabled')]
[string]
$BuildsAccessLevel,

[Parameter(Mandatory=$false)]
[switch]
[Parameter()]
[ValidateSet($null, 'true', 'false')]
[object]
$OnlyAllowMergeIfAllDiscussionsAreResolved,

[Parameter(Mandatory=$false)]
[Parameter()]
[string]
$SiteUrl
)
Expand Down Expand Up @@ -484,17 +485,11 @@ function Update-GitlabProject {
if ($BuildsAccessLevel) {
$Query.builds_access_level = $BuildsAccessLevel
}

if($PSBoundParameters.ContainsKey("OnlyAllowMergeIfAllDiscussionsAreResolved") -and `
$Project.OnlyAllowMergeIfAllDiscussionsAreResolved -ne $OnlyAllowMergeIfAllDiscussionsAreResolved
) {
if ($OnlyAllowMergeIfAllDiscussionsAreResolved) {
$Query.only_allow_merge_if_all_discussions_are_resolved = $OnlyAllowMergeIfAllDiscussionsAreResolved
}

if($Query.Keys.Count -le 0) {
Write-Host "Nothing to update"
$Project
} elseif ($PSCmdlet.ShouldProcess("$($Project.PathWithNamespace)", "update project ($($Query | ConvertTo-Json))")) {
if ($PSCmdlet.ShouldProcess("$($Project.PathWithNamespace)", "update project ($($Query | ConvertTo-Json))")) {
Invoke-GitlabApi PUT "projects/$($Project.Id)" $Query -SiteUrl $SiteUrl |
New-WrapperObject 'Gitlab.Project'
}
Expand Down

0 comments on commit f7cfcea

Please sign in to comment.