Skip to content

Commit

Permalink
🪲 [Refactor]: Update verbose logging for user, organization, and ente…
Browse files Browse the repository at this point in the history
…rprise filters in Connect-GitHubApp
  • Loading branch information
MariusStorhaug committed Jan 29, 2025
1 parent b7a0a59 commit eabbbbc
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/functions/public/Auth/Connect-GitHubApp.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -86,21 +86,21 @@
'Filtered' {
$User | ForEach-Object {
$userItem = $_
Write-Verbose "Adding installation based on user [$userItem]."
Write-Verbose "User filter: [$userItem]."
$selectedInstallations += $installations | Where-Object {
$_.target_type -eq 'User' -and $_.account.login -like $userItem
}
}
$Organization | ForEach-Object {
$organizationItem = $_
Write-Verbose "Filtering installations for organization [$organizationItem]."
Write-Verbose "Organization filter: [$organizationItem]."
$selectedInstallations += $installations | Where-Object {
$_.target_type -eq 'Organization' -and $_.account.login -like $organizationItem
}
}
$Enterprise | ForEach-Object {
$enterpriseItem = $_
Write-Verbose "Filtering installations for enterprise [$enterpriseItem]."
Write-Verbose "Enterprise filter: [$enterpriseItem]."
$selectedInstallations += $installations | Where-Object {
$_.target_type -eq 'Enterprise' -and $_.account.slug -like $enterpriseItem
}
Expand All @@ -112,8 +112,8 @@
}
}

Write-Verbose "Found [$($installations.Count)] installations for the target."
$installations | ForEach-Object {
Write-Verbose "Found [$($selectedInstallations.Count)] installations for the target."
$selectedInstallations | ForEach-Object {
$installation = $_
Write-Verbose "Processing installation [$($installation.account.login)] [$($installation.id)]"
$token = New-GitHubAppInstallationAccessToken -Context $Context -InstallationID $installation.id
Expand Down

0 comments on commit eabbbbc

Please sign in to comment.