Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -378,14 +378,23 @@ jobs:
$path = Join-Path -Path $env:GITHUB_WORKSPACE -ChildPath "${{ inputs.ModulesOutputPath }}\$moduleName"
$moduleManifestPath = Join-Path -Path $Path -ChildPath "$moduleName.psd1"

# Obay module manifest overrides
$sourcePath = Join-Path -Path $env:GITHUB_WORKSPACE -ChildPath "${{ inputs.Path }}"
$sourceModuleManifestPath = Join-Path -Path $sourcePath -ChildPath "manifest.psd1"
if (Test-Path -Path $sourceModuleManifestPath) {
$sourceManifest = Import-PowerShellDataFile -Path $sourceModuleManifestPath
}

$data = [pscustomobject]@{
ModuleName = $moduleName
Path = $path
ModuleManifestPath = $moduleManifestPath
}
Write-Verbose ($data | Format-List | Out-String) -Verbose

Set-ModuleManifest -Path $moduleManifestPath -PowerShellVersion '7.4'
# If the source module manifest has a PowerShellVersion, use that, otherwise use the latest version.
$powerShellVersion = $sourceManifest.PowerShellVersion ?? '7.4'
Set-ModuleManifest -Path $moduleManifestPath -PowerShellVersion $powerShellVersion

Add-ModuleManifestData -Path $moduleManifestPath -CompatiblePSEditions 'Core'
Add-ModuleManifestData -Path $moduleManifestPath -Tags 'PSEdition_Core'
Expand All @@ -403,6 +412,10 @@ jobs:
}
}

LogGroup 'Module Manifest - Source' {
Show-FileContent -Path $moduleManifestPath
}

LogGroup 'Module Manifest' {
Show-FileContent -Path $moduleManifestPath
}
Expand Down
3 changes: 2 additions & 1 deletion tests/srcWithManifest/manifest.psd1
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
@{
Author = 'Author'
Author = 'Author'
PowerShellVersion = '5.1'
}