diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 72369531..09719661 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -476,7 +476,7 @@ jobs: uses: actions/download-artifact@v4 with: name: docs - path: ${{ inputs.DocsOutputPath }} + path: '${{ inputs.SiteOutputPath }}/docs/Functions' - name: Debug uses: PSModule/Debug@v0 @@ -495,20 +495,11 @@ jobs: uses: PSModule/GitHub-Script@v1 with: Script: | - $ModuleName = '${{ inputs.Name }}' + $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 }}' - if (-not $ModuleName) { - $ModuleName = $env:GITHUB_REPOSITORY -replace '.+/' - } - Write-Verbose "Module name: $ModuleName" - - $ModuleSourcePath = Join-Path (Get-Location) -ChildPath '${{ inputs.Path }}' - $DocsOutputPath = Join-Path (Get-Location) -ChildPath "${{ inputs.DocsOutputPath }}/$ModuleName" - $SiteOutputPath = Join-Path (Get-Location) -ChildPath '${{ inputs.SiteOutputPath }}' - - $functionDocsFolderPath = Join-Path -Path $SiteOutputPath -ChildPath 'docs/Functions' - $functionDocsFolder = New-Item -Path $functionDocsFolderPath -ItemType Directory -Force - Get-ChildItem -Path $DocsOutputPath -Recurse -Force -Include '*.md' | Copy-Item -Destination $functionDocsFolder -Recurse -Force + $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 diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 8f3d8e60..a0aa1195 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -502,17 +502,10 @@ jobs: uses: actions/download-artifact@v4 with: name: docs - path: ${{ inputs.DocsOutputPath }} + path: '${{ inputs.SiteOutputPath }}/docs/Functions' - - name: Debug File system - shell: pwsh - run: | - Get-ChildItem -Path $env:GITHUB_WORKSPACE -Recurse | Select-Object -ExpandProperty FullName | Sort-Object - - - name: Debug Env vars - shell: pwsh - run: | - Get-ChildItem env: | Format-Table + - name: Debug + uses: PSModule/Debug@v0 - uses: actions/configure-pages@v5 @@ -528,20 +521,11 @@ jobs: uses: PSModule/GitHub-Script@v1 with: Script: | - $ModuleName = '${{ inputs.Name }}' - - if (-not $ModuleName) { - $ModuleName = $env:GITHUB_REPOSITORY -replace '.+/' - } - Write-Verbose "Module name: $ModuleName" - - $ModuleSourcePath = Join-Path (Get-Location) -ChildPath '${{ inputs.Path }}' - $DocsOutputPath = Join-Path (Get-Location) -ChildPath "${{ inputs.DocsOutputPath }}/$ModuleName" - $SiteOutputPath = Join-Path (Get-Location) -ChildPath '${{ inputs.SiteOutputPath }}' + $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 }}' - $functionDocsFolderPath = Join-Path -Path $SiteOutputPath -ChildPath 'docs/Functions' - $functionDocsFolder = New-Item -Path $functionDocsFolderPath -ItemType Directory -Force - Copy-Item -Path $DocsOutputPath -Destination $functionDocsFolder -Recurse -Force + $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