Skip to content

Commit 3cd3a9f

Browse files
🚀 [Refactor]: Remove unnecessary initialization of contextObjects and streamline context parameter handling in Connect-GitHubApp.
1 parent f2a17bb commit 3cd3a9f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

‎src/functions/public/Auth/Connect-GitHubApp.ps1‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,6 @@
9696
Write-Debug "[$stackPath] - Start"
9797
$Context = Resolve-GitHubContext -Context $Context
9898
Assert-GitHubContext -Context $Context -AuthType App
99-
$contextObjects = [System.Collections.ArrayList]::new()
10099
}
101100

102101
process {
@@ -198,9 +197,10 @@
198197
}
199198
$contextParams
200199
} | ForEach-Object {
200+
$contextParams = $_.Clone()
201201
Write-Verbose 'Logging in using a managed installation access token...'
202202
$contextParams | Format-Table | Out-String -Stream | ForEach-Object { Write-Verbose $_ }
203-
$contextObj = [GitHubAppInstallationContext]::new((Set-GitHubContext -Context $contextParams.Clone() -PassThru -Default:$Default))
203+
$contextObj = [GitHubAppInstallationContext]::new((Set-GitHubContext -Context $contextParams -PassThru -Default:$Default))
204204
$contextObj | Format-List | Out-String -Stream | ForEach-Object { Write-Verbose $_ }
205205
if (-not $Silent) {
206206
$name = $contextObj.Name

0 commit comments

Comments
 (0)