diff --git a/.github/workflows/Action-Test.yml b/.github/workflows/Action-Test.yml index e734696..23df0ab 100644 --- a/.github/workflows/Action-Test.yml +++ b/.github/workflows/Action-Test.yml @@ -15,7 +15,9 @@ concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true -permissions: {} +permissions: + contents: read # to checkout the repo + statuses: write # to create commit status jobs: ActionTestDefault: @@ -24,6 +26,9 @@ jobs: steps: - name: Checkout repo uses: actions/checkout@v5 + with: + persist-credentials: false + fetch-depth: 0 - name: Upload module artifact uses: actions/upload-artifact@v4 @@ -38,3 +43,21 @@ jobs: with: Name: PSModuleTest WorkingDirectory: tests/srcTestRepo + + - name: Get changes + uses: PSModule/GitHub-Script@v1 + with: + Script: | + LogGroup "List files" { + Get-ChildItem -Recurse -File | Select-Object -ExpandProperty FullName | Sort-Object + } + LogGroup "Commit changes" { + git add tests/srcTestRepo/outputs/docs/ + git commit -m "Update documentation" + } + + - name: Lint documentation + uses: super-linter/super-linter/slim@7bba2eeb89d01dc9bfd93c497477a57e72c83240 # v8.2.0 + env: + GITHUB_TOKEN: ${{ github.token }} + VALIDATE_MARKDOWN: true diff --git a/scripts/helpers/Build-PSModuleDocumentation.ps1 b/scripts/helpers/Build-PSModuleDocumentation.ps1 index d979beb..5670eee 100644 --- a/scripts/helpers/Build-PSModuleDocumentation.ps1 +++ b/scripts/helpers/Build-PSModuleDocumentation.ps1 @@ -48,7 +48,7 @@ Write-Host '::group::Build docs - Generate markdown help - Raw' Install-PSModule -Path $ModuleOutputFolder Write-Host ($ModuleName | Get-Module) - $null = New-MarkdownHelp -Module $ModuleName -OutputFolder $DocsOutputFolder -Force -Verbose + $null = New-MarkdownHelp -Module $ModuleName -OutputFolder $DocsOutputFolder -Force -Encoding UTF8 Get-ChildItem -Path $DocsOutputFolder -Recurse -Force -Include '*.md' | ForEach-Object { $fileName = $_.Name Write-Host "::group:: - [$fileName]" diff --git a/tests/srcTestRepo/outputs/module/PSModuleTest/PSModuleTest.psm1 b/tests/srcTestRepo/outputs/module/PSModuleTest/PSModuleTest.psm1 index dfe05df..be31abb 100644 --- a/tests/srcTestRepo/outputs/module/PSModuleTest/PSModuleTest.psm1 +++ b/tests/srcTestRepo/outputs/module/PSModuleTest/PSModuleTest.psm1 @@ -314,6 +314,12 @@ function Set-PSModuleTest { Test-PSModule -Name 'World' "Hello, World!" + + .NOTES + Controls: + - :q : Quit + - :q! : Quit without saving + - :wq : Save and quit #> [Diagnostics.CodeAnalysis.SuppressMessageAttribute( 'PSUseShouldProcessForStateChangingFunctions', '', Scope = 'Function', diff --git a/tests/srcTestRepo/src/functions/public/SomethingElse/Set-PSModuleTest.ps1 b/tests/srcTestRepo/src/functions/public/SomethingElse/Set-PSModuleTest.ps1 index a87ac11..db379c1 100644 --- a/tests/srcTestRepo/src/functions/public/SomethingElse/Set-PSModuleTest.ps1 +++ b/tests/srcTestRepo/src/functions/public/SomethingElse/Set-PSModuleTest.ps1 @@ -7,6 +7,12 @@ Test-PSModule -Name 'World' "Hello, World!" + + .NOTES + Controls: + - :q : Quit + - :q! : Quit without saving + - :wq : Save and quit #> [Diagnostics.CodeAnalysis.SuppressMessageAttribute( 'PSUseShouldProcessForStateChangingFunctions', '', Scope = 'Function',