-
Notifications
You must be signed in to change notification settings - Fork 125
Closed
Labels
good first issueGood for newcomersGood for newcomersmaintenanceMaintenance work, no version bumpMaintenance work, no version bump
Milestone
Description
Note
Partial Completion Status (assessed 2026-02-13)
Completed:
- Shared
Write-SecurityLogfunction created inSecurityHelpers.psm1(scripts/security/Modules/) CIHelpers.psm1exists with CI platform detection and annotation functions
Remaining:
Test-DependencyPinning.ps1still contains localWrite-PinningLogfunction (~25 lines)Test-SHAStaleness.ps1still contains localWrite-SecurityLogfunction (~25 lines)- Neither script imports the shared module or uses the consolidated function
- No
Write-ScriptLogequivalent added toLintingHelpers.psm1as originally proposed
Issue Description
Multiple PowerShell scripts define nearly identical logging functions that support GitHub Actions, Azure DevOps, and console output formats. Write-PinningLog in scripts/security/Test-DependencyPinning.ps1 and Write-SecurityLog in scripts/security/Test-SHAStaleness.ps1 share the same structure and should be consolidated into a single shared function in scripts/linting/Modules/LintingHelpers.psm1.
Additional Context
Current duplication:
Test-DependencyPinning.ps1:Write-PinningLog(~25 lines)Test-SHAStaleness.ps1:Write-SecurityLog(~25 lines)
Recommended approach:
- Add
Write-ScriptLogtoLintingHelpers.psm1with-Level(Info/Warning/Error/Debug) and-OutputFormat(github/azdo/console) parameters - Update both security scripts to import and use the shared function
- Remove the duplicate local functions
Testing:
- Run
npm run pesterto verify existing tests pass - Manually verify output formatting in GitHub Actions workflow
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
good first issueGood for newcomersGood for newcomersmaintenanceMaintenance work, no version bumpMaintenance work, no version bump