From 96de4510f022f03a31b7c4d30d299f82e6b4d54f Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Fri, 14 Feb 2025 08:54:16 +0100 Subject: [PATCH 1/2] Fix placement of docs after copy --- .github/workflows/CI.yml | 2 +- .github/workflows/workflow.yml | 18 +++++++++++------- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index c881f7da..06a894a1 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -307,7 +307,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 24be9dff..3cbf404f 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -273,8 +273,13 @@ jobs: # Rename the gitignore file to .gitignore.bak Rename-Item -Path '.gitignore' -NewName '.gitignore.bak' -Force - git add . - git commit -m 'Update documentation' + 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 @@ -314,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 $_ } } From 89f2ab11ecf7faccbd6548d1fb8bdde6171acd67 Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Fri, 14 Feb 2025 09:25:28 +0100 Subject: [PATCH 2/2] =?UTF-8?q?=F0=9F=A9=B9=20[Patch]:=20Handle=20case=20w?= =?UTF-8?q?here=20there=20are=20no=20changes=20to=20commit=20in=20CI=20wor?= =?UTF-8?q?kflow?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/CI.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 06a894a1..db8e7728 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -266,8 +266,13 @@ jobs: # Rename the gitignore file to .gitignore.bak Rename-Item -Path '.gitignore' -NewName '.gitignore.bak' -Force - git add . - git commit -m 'Update documentation' + 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