Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🩹 [Patch]: Swap dependency to the
Uri
PowerShell module (#305)
## Description This pull request introduces a new function to resolve GitHub context settings and refactors the `Invoke-GitHubAPI` function to utilize this new function for cleaner and more maintainable code. ### New Functionality: * [`src/functions/private/Auth/Context/Resolve-GitHubContextSetting.ps1`](diffhunk://#diff-0385a485041b5821c5eac5351ca9c97ec775c09ac21cf776625811e8868c6a8fR1-R46): Added a new function `Resolve-GitHubContextSetting` to dynamically retrieve setting values from a given GitHub context. This function simplifies the process of resolving API-related settings. ### Refactoring: * [`src/functions/public/API/Invoke-GitHubAPI.ps1`](diffhunk://#diff-9285dd3cdd5467d93c8e68c989041171e17993971649b877dce001b1861b2c39L104-R107): Replaced inline context setting retrievals with calls to the new `Resolve-GitHubContextSetting` function for `HttpVersion`, `ApiBaseUri`, `ApiVersion`, and `TokenType`. This change enhances code readability and maintainability. * [`src/functions/public/API/Invoke-GitHubAPI.ps1`](diffhunk://#diff-9285dd3cdd5467d93c8e68c989041171e17993971649b877dce001b1861b2c39L1-R1): Updated the module requirement from 'Web' to 'Uri' to support the new URI handling functions. * [`src/functions/public/API/Invoke-GitHubAPI.ps1`](diffhunk://#diff-9285dd3cdd5467d93c8e68c989041171e17993971649b877dce001b1861b2c39L143-R128): Replaced manual URI construction with the `New-Uri` function for better readability and reliability. [[1]](diffhunk://#diff-9285dd3cdd5467d93c8e68c989041171e17993971649b877dce001b1861b2c39L143-R128) [[2]](diffhunk://#diff-9285dd3cdd5467d93c8e68c989041171e17993971649b877dce001b1861b2c39L167-R152) ## Type of change <!-- Use the check-boxes [x] on the options that are relevant. --> - [ ] 📖 [Docs] - [ ] 🪲 [Fix] - [x] 🩹 [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