Skip to content

test(scripts): improve test coverage for Update-ActionSHAPinning.ps1 #327

@WilliamBerryiii

Description

@WilliamBerryiii

Issue Description

The Update-ActionSHAPinning.ps1 script has thin test coverage at 222 lines. This security-related script manages SHA pinning for GitHub Actions and warrants comprehensive unit tests to ensure reliability.

Current state:

  • Test file: scripts/tests/security/Update-ActionSHAPinning.Tests.ps1 (222 lines)
  • Coverage target: 80%

Suggested test areas:

  • Parameter validation (action patterns, dry-run mode)
  • SHA resolution and update logic
  • File discovery and filtering
  • Error handling for API failures
  • Output formatting and reporting

Additional Context

This follows the test coverage improvement pattern established in:

Reference the existing test patterns in scripts/tests/ for mocking strategies and Pester 5.x conventions.

Metadata

Metadata

Labels

good first issueGood for newcomerstestingTest infrastructure and test files

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions