🩹 [Patch]: Swap dependency to the Uri
PowerShell module
#305
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
: Added a new functionResolve-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
: Replaced inline context setting retrievals with calls to the newResolve-GitHubContextSetting
function forHttpVersion
,ApiBaseUri
,ApiVersion
, andTokenType
. This change enhances code readability and maintainability.src/functions/public/API/Invoke-GitHubAPI.ps1
: Updated the module requirement from 'Web' to 'Uri' to support the new URI handling functions.src/functions/public/API/Invoke-GitHubAPI.ps1
: Replaced manual URI construction with theNew-Uri
function for better readability and reliability. [1] [2]Type of change
Checklist