Summary
Two GitHub Actions workflows contain embedded PowerShell logic that cannot be unit-tested in isolation. This issue tracks extracting that logic into standalone scripts with full Pester test coverage.
Target Workflows
| Workflow |
Step |
Embedded Logic |
pester-tests.yml |
Get changed PowerShell files |
Git diff parsing, source-to-test mapping, skill directory discovery |
extension-package.yml |
Discover collection manifests |
YAML parsing, maturity filtering, matrix JSON generation |
Approach
- Extract each embedded block into a standalone
.ps1 script following the reference pattern from Invoke-PSScriptAnalyzer.ps1 (shebang, copyright, Requires, CmdletBinding, regions, script guard).
- Use
CIHelpers.psm1 (Set-CIEnv, Set-CIOutput) instead of raw $env:GITHUB_OUTPUT file I/O.
- Write Pester 5.7.1 tests for each extracted script using
GitMocks.psm1 patterns.
- Replace workflow embedded blocks with thin wrapper calls to the new scripts.
Deliverables
Summary
Two GitHub Actions workflows contain embedded PowerShell logic that cannot be unit-tested in isolation. This issue tracks extracting that logic into standalone scripts with full Pester test coverage.
Target Workflows
pester-tests.ymlextension-package.ymlApproach
.ps1script following the reference pattern fromInvoke-PSScriptAnalyzer.ps1(shebang, copyright, Requires, CmdletBinding, regions, script guard).CIHelpers.psm1(Set-CIEnv,Set-CIOutput) instead of raw$env:GITHUB_OUTPUTfile I/O.GitMocks.psm1patterns.Deliverables
scripts/tests/Get-ChangedTestFiles.ps1— extracted changed-file detection logicscripts/tests/Get-ChangedTestFiles.Tests.ps1— Pester tests for changed-file detectionscripts/extension/Find-CollectionManifests.ps1— extracted collection manifest discoveryscripts/tests/extension/Find-CollectionManifests.Tests.ps1— Pester tests for manifest discoverypester-tests.ymlwith thin wrapper callextension-package.ymlwith thin wrapper callnpm run lint:all,npm run test:ps)