Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🪲 [Fix]: Consistant output generated with
Set-GithubOutput
(#314)
## Description This pull request includes changes to improve the handling of JSON conversion and parameter attributes in PowerShell scripts. The most important changes include modifying how JSON strings are normalized, converting non-string values to JSON, and updating parameter attributes to support pipeline input. Improvements to JSON handling: * [`src/functions/private/Commands/ConvertTo-GitHubOutput.ps1`](diffhunk://#diff-034d54e9e300e69d4f8ec92a22bf2cec2e21f82b9ff6d0d59af1014bebe56b10L74-R85): Added logic to normalize valid JSON strings to a consistent format and ensured non-string values are converted to JSON. * [`src/functions/public/Commands/Set-GitHubOutput.ps1`](diffhunk://#diff-e3aad576b04b558ce2a70ebd0dcc703418e81431e3c0f0ed63a3736ae35de2efL60-L64): Removed redundant JSON conversion for `Hashtable` and `PSCustomObject` types and added conversion for non-string values when running in a GitHub composite action. [[1]](diffhunk://#diff-e3aad576b04b558ce2a70ebd0dcc703418e81431e3c0f0ed63a3736ae35de2efL60-L64) [[2]](diffhunk://#diff-e3aad576b04b558ce2a70ebd0dcc703418e81431e3c0f0ed63a3736ae35de2efR68-R70) Parameter attribute updates: * [`src/functions/public/Commands/Set-GitHubStepSummary.ps1`](diffhunk://#diff-c61e80066627b1dda0dc3fcf76fba52207ce7bfc17fd55f9fc6cc58dc0f813b8L37-R40): Updated the `Summary` parameter to support pipeline input by adding the `ValueFromPipeline` attribute. ## Type of change <!-- Use the check-boxes [x] on the options that are relevant. --> - [ ] 📖 [Docs] - [x] 🪲 [Fix] - [ ] 🩹 [Patch] - [ ]⚠️ [Security fix] - [ ] 🚀 [Feature] - [ ] 🌟 [Breaking change] ## Checklist <!-- Use the check-boxes [x] on the options that are relevant. --> - [x] I have performed a self-review of my own code - [x] I have commented my code, particularly in hard-to-understand areas
- Loading branch information