Skip to content

Conversation

@littleKitchen
Copy link
Contributor

Fixes #287

Summary

Migrate inline GitHub Actions and Azure DevOps CI code to use the centralized CIHelpers.psm1 module functions.

Changes

  • Test-DependencyPinning.ps1: Replace inline CI code with Set-CIOutput, Write-CIStepSummary, Publish-CIArtifact, Write-CIAnnotation
  • Package-Extension.ps1: Replace inline GITHUB_OUTPUT writes with Set-CIOutput
  • Test-SHAStaleness.ps1: Replace inline annotations with Write-CIAnnotation, Set-CITaskResult
  • Update-ActionSHAPinning.ps1: Replace inline annotations with Write-CIAnnotation, Set-CITaskResult

Benefits

  • Eliminates ~50 lines of duplicate CI platform detection code
  • Centralizes security escaping (workflow command injection prevention)
  • Consistent behavior across GitHub Actions and Azure DevOps
  • Easier maintenance - CI output logic in one place

Testing

  • All 57 CIHelpers.Tests.ps1 tests pass
  • No PSScriptAnalyzer errors on modified files
  • All files end with newline (per contribution guidelines)

Fixes microsoft#287

Replace inline GitHub Actions and Azure DevOps CI code with calls to
the CIHelpers.psm1 module functions:

- Test-DependencyPinning.ps1: Use Set-CIOutput, Write-CIStepSummary,
  Publish-CIArtifact, Write-CIAnnotation
- Package-Extension.ps1: Use Set-CIOutput
- Test-SHAStaleness.ps1: Use Write-CIAnnotation, Set-CITaskResult
- Update-ActionSHAPinning.ps1: Use Write-CIAnnotation, Set-CITaskResult

This eliminates ~50 lines of duplicate CI platform detection and output
formatting code while improving consistency and security (proper escaping
is now centralized in CIHelpers).
@littleKitchen littleKitchen requested a review from a team as a code owner February 3, 2026 06:59
@littleKitchen
Copy link
Contributor Author

FYI — the acceptance criteria in #287 (module creation, tests, etc.) were already done in #348 and #354. This PR just handles the migration part mentioned in the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Create CIHelpers.psm1 shared module for CI platform detection and output

1 participant