diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 29cde5cc..db8e7728 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -260,9 +260,22 @@ jobs: Version: ${{ inputs.Version }} - name: Commit all changes + continue-on-error: true + shell: pwsh run: | - git add . - git commit -m 'Update documentation' + # Rename the gitignore file to .gitignore.bak + Rename-Item -Path '.gitignore' -NewName '.gitignore.bak' -Force + + try { + # Add all changes to the repository + git add . + git commit -m 'Update documentation' + } catch { + Write-Host "No changes to commit" + } + + # Restore the gitignore file + Rename-Item -Path '.gitignore.bak' -NewName '.gitignore' -Force - name: Lint documentation uses: super-linter/super-linter/slim@latest @@ -299,7 +312,7 @@ jobs: Version: ${{ inputs.Version }} Script: | New-Item -Path "$env:GITHUB_WORKSPACE/${{ inputs.SiteOutputPath }}/docs/Functions" -ItemType Directory -Force - Copy-Item -Path "$env:GITHUB_WORKSPACE/${{ inputs.DocsOutputPath }}" -Destination "$env:GITHUB_WORKSPACE/${{ inputs.SiteOutputPath }}/docs/Functions" -Recurse -Force + Copy-Item -Path "$env:GITHUB_WORKSPACE/${{ inputs.DocsOutputPath }}/*" -Destination "$env:GITHUB_WORKSPACE/${{ inputs.SiteOutputPath }}/docs/Functions" -Recurse -Force $moduleName = [string]::IsNullOrEmpty('${{ inputs.Name }}') ? $env:GITHUB_REPOSITORY_NAME : '${{ inputs.Name }}' $ModuleSourcePath = Join-Path $PWD -ChildPath '${{ inputs.Path }}' $SiteOutputPath = Join-Path $PWD -ChildPath '${{ inputs.SiteOutputPath }}' diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 410439a8..3cbf404f 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -267,9 +267,22 @@ jobs: Version: ${{ inputs.Version }} - name: Commit all changes + continue-on-error: true + shell: pwsh run: | - git add . - git commit -m 'Update documentation' + # Rename the gitignore file to .gitignore.bak + Rename-Item -Path '.gitignore' -NewName '.gitignore.bak' -Force + + try { + # Add all changes to the repository + git add . + git commit -m 'Update documentation' + } catch { + Write-Host "No changes to commit" + } + + # Restore the gitignore file + Rename-Item -Path '.gitignore.bak' -NewName '.gitignore' -Force - name: Lint documentation uses: super-linter/super-linter/slim@latest @@ -306,20 +319,19 @@ jobs: Version: ${{ inputs.Version }} Script: | New-Item -Path "$env:GITHUB_WORKSPACE/${{ inputs.SiteOutputPath }}/docs/Functions" -ItemType Directory -Force - Copy-Item -Path "$env:GITHUB_WORKSPACE/${{ inputs.DocsOutputPath }}" -Destination "$env:GITHUB_WORKSPACE/${{ inputs.SiteOutputPath }}/docs/Functions" -Recurse -Force + Copy-Item -Path "$env:GITHUB_WORKSPACE/${{ inputs.DocsOutputPath }}/*" -Destination "$env:GITHUB_WORKSPACE/${{ inputs.SiteOutputPath }}/docs/Functions" -Recurse -Force $moduleName = [string]::IsNullOrEmpty('${{ inputs.Name }}') ? $env:GITHUB_REPOSITORY_NAME : '${{ inputs.Name }}' $ModuleSourcePath = Join-Path $PWD -ChildPath '${{ inputs.Path }}' $SiteOutputPath = Join-Path $PWD -ChildPath '${{ inputs.SiteOutputPath }}' - LogGroup "Get folderstructure" { - Get-ChildItem -Recurse | Select-Object -ExpandProperty FullName | Sort-Object + LogGroup "Get folder structure" { + Get-ChildItem -Recurse | Select-Object -ExpandProperty FullName | Sort-Object | Format-List } $functionDocsFolder = Join-Path -Path $SiteOutputPath -ChildPath 'docs/Functions' | Get-Item Get-ChildItem -Path $functionDocsFolder -Recurse -Force -Include '*.md' | ForEach-Object { $fileName = $_.Name - $hash = (Get-FileHash -Path $_.FullName -Algorithm SHA256).Hash - LogGroup " - [$fileName] - [$hash]" { + LogGroup " - $fileName" { Show-FileContent -Path $_ } } diff --git a/tests/srcTestRepo/src/functions/public/completers.ps1 b/tests/srcTestRepo/src/functions/public/completers.ps1 new file mode 100644 index 00000000..6b1adbb7 --- /dev/null +++ b/tests/srcTestRepo/src/functions/public/completers.ps1 @@ -0,0 +1,8 @@ +Register-ArgumentCompleter -CommandName New-PSModuleTest -ParameterName Name -ScriptBlock { + param($commandName, $parameterName, $wordToComplete, $commandAst, $fakeBoundParameters) + $null = $commandName, $parameterName, $wordToComplete, $commandAst, $fakeBoundParameters + + 'Alice', 'Bob', 'Charlie' | Where-Object { $_ -like "$wordToComplete*" } | ForEach-Object { + [System.Management.Automation.CompletionResult]::new($_, $_, 'ParameterValue', $_) + } +} diff --git a/tests/srcWithManifestTestRepo/src/functions/public/Test-PSModuleTest.ps1 b/tests/srcWithManifestTestRepo/src/functions/public/Test-PSModuleTest.ps1 index 4056e2f6..26be2b9b 100644 --- a/tests/srcWithManifestTestRepo/src/functions/public/Test-PSModuleTest.ps1 +++ b/tests/srcWithManifestTestRepo/src/functions/public/Test-PSModuleTest.ps1 @@ -1,5 +1,4 @@ -#SkipTest:Verbose:Just want to test that a function can have multiple skips. -function Test-PSModuleTest { +function Test-PSModuleTest { <# .SYNOPSIS Performs tests on a module. @@ -16,5 +15,4 @@ function Test-PSModuleTest { [string] $Name ) Write-Output "Hello, $Name!" - Write-Verbose 'Verbose message' -Verbose }