Skip to content

Commit 190e46b

Browse files
🪲 [Fix]: Fix an issue with outputs for Get-GitHubAppAccessibleRepository (#412)
## Description This pull request makes changes to the way `Get-GitHubAppAccessibleRepository` handles outputs of GitHub repository objects. ### Functional improvements: * Updated the loop in the `Invoke-GitHubAPI` pipeline to process each repository in the response individually using a `foreach` block, ensuring proper instantiation of `GitHubRepository` objects. ### Code cleanup: * Removed the unused `.NOTES` section from the script's comment-based help documentation to streamline the file. ## 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 --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent 3d2399c commit 190e46b

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

src/functions/public/Apps/GitHub App Installations/Get-GitHubAppAccessibleRepository.ps1

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,6 @@
2424
2525
.LINK
2626
https://psmodule.io/GitHub/Functions/Apps/GitHub%20App%20Installations/Get-GitHubAppAccessibleRepository
27-
28-
.NOTES
29-
3027
#>
3128
[OutputType([GitHubRepository[]])]
3229
[CmdletBinding(SupportsShouldProcess)]
@@ -72,7 +69,16 @@
7269
}
7370

7471
Invoke-GitHubAPI @inputObject | ForEach-Object {
75-
[GitHubRepository]::($_.Response)
72+
foreach ($repo in $_.Response) {
73+
[GitHubRepository]@{
74+
ID = $repo.id
75+
Name = $repo.name
76+
Owner = [GitHubOwner]@{
77+
Name = $Organization
78+
}
79+
FullName = $repo.full_name
80+
}
81+
}
7682
}
7783
}
7884

0 commit comments

Comments
 (0)