Skip to content

Commit

Permalink
Validate helpout version in docs update
Browse files Browse the repository at this point in the history
  • Loading branch information
ShaunLawrie committed Mar 15, 2024
1 parent 943191b commit 6920fb1
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-test-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ jobs:
gh release create "v$newVersion-$newPrereleaseTag" --target prerelease --generate-notes --prerelease
# Publish prerelease docs
Install-Module HelpOut -Scope CurrentUser -Force
Install-Module HelpOut -Scope CurrentUser -RequiredVersion 0.5 -Force
& .\PwshSpectreConsole.Docs\src\powershell\UpdateDocs.ps1 -NonInteractive
git config --global user.name 'Shaun Lawrie (via GitHub Actions)'
git config --global user.email '[email protected]'
Expand Down
2 changes: 1 addition & 1 deletion PwshSpectreConsole.Docs/src/powershell/Helpers.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ function Get-GitCommitDatesForHashFile {
try {
Set-Location $OutputPath
$group = Get-Group -Name $Name
$hashfileName = "_" + ($doc.Name -replace '.md$', '.sha256')
$hashfileName = "_" + ($Name -replace '.md$', '.sha256')
$gitHashfileName = Join-Path $group.Name $hashfileName
Write-Host "Getting git log for $gitHashfileName in cwd $OutputPath"
$dates = git log --follow --pretty="format:%ci" -- $gitHashfileName
Expand Down
7 changes: 7 additions & 0 deletions PwshSpectreConsole.Docs/src/powershell/UpdateDocs.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@ param(

$ErrorActionPreference = "Stop"

# The new version has a bug which is failing this on windows
$helpOut = Get-Module "HelpOut" -ListAvailable
if($helpOut.Version.ToString() -ne "0.5") {
throw "Must be run with HelpOut v0.5"
}

& "$PSScriptRoot\..\..\..\PwshSpectreConsole\Build.ps1"

Import-Module "$PSScriptRoot\..\..\..\PwshSpectreConsole\PwshSpectreConsole.psd1" -Force
Expand Down Expand Up @@ -52,6 +58,7 @@ foreach ($doc in $docs) {
}

# Update the hash files in git so the modified files can be detected
# I regret doing it this way but cbf changing it now
Update-HashFilesInGit -StagingPath $stagingPath -OutputPath $outputPath

# Format the files for astro
Expand Down

0 comments on commit 6920fb1

Please sign in to comment.