Commit a489f06
🚀 [Feature]: Get-GitHubRepository now returns custom properties inline (#555)
`Get-GitHubRepository` now includes custom properties directly on the
returned object — no separate API call needed. GraphQL queries that
encounter unavailable fields now return partial results with warnings
instead of failing, and commands that target non-existent resources
return nothing instead of throwing errors. Various spelling corrections
across source files, documentation, and tests are also included.
- Fixes #554
- Fixes #557
- Fixes #558
- Fixes #559
## New: Custom properties on `Get-GitHubRepository` results
`Get-GitHubRepository` now returns custom properties inline when
retrieving a repository by name. Previously, retrieving custom
properties required a separate call to
`Get-GitHubRepositoryCustomProperty`.
```powershell
$repo = Get-GitHubRepository -Owner 'PSModule' -Name 'GitHub'
$repo.CustomProperties | Format-Table
# Name Value
# ---- -----
# Type Module
# Status Active
```
A new strongly-typed `GitHubCustomProperty` class provides `Name` and
`Value` properties with consistent casing regardless of whether the data
comes from the REST or GraphQL API.
> **Note**: Custom properties are populated when using
`Get-GitHubRepository` to fetch a specific repository. Other commands
that return repository objects (e.g., listing repositories) may not
include custom properties depending on the underlying API response.
`Get-GitHubRepositoryCustomProperty` remains available if you only need
custom properties without the full repository object.
## Fixed: Queries no longer fail when some fields are unavailable
GraphQL queries that encounter fields unavailable for some repositories
(such as custom properties on repos where permissions are limited) now
return the available data and emit warnings for the errors. Previously,
any GraphQL error — even with valid data — caused a terminating error.
## Fixed: Commands no longer throw when a resource doesn't exist
Commands that query a specific repository, enterprise, or release by
name now return nothing instead of throwing an error when the resource
doesn't exist. This makes it safe to use these commands in conditional
logic without wrapping them in try/catch.
## Technical Details
- New `GitHubCustomProperty` class in
`src/classes/public/Repositories/GitHubCustomProperty.ps1` with
constructors accepting both REST (`property_name`) and GraphQL
(`propertyName`) field names.
- `GitHubRepository` class: `CustomProperties` property changed from
`[PSCustomObject]` to `[GitHubCustomProperty[]]`. `PropertyToGraphQLMap`
entry now maps to `repositoryCustomPropertyValues(first: 100) { nodes {
propertyName value } }`.
- `CustomProperties` removed from the GraphQL field exclusion list in
`Get-GitHubRepositoryByName` and `Get-GitHubMyRepositoryByName` only —
these are the private functions behind `Get-GitHubRepository`.
- `Invoke-GitHubGraphQLQuery`: Error handling split into partial-success
(data + errors → warnings) and full-failure (errors only → terminating
error) branches.
- Null guards added to `Get-GitHubRepositoryByName`,
`Get-GitHubMyRepositoryByName`, `Get-GitHubEnterpriseByName`,
`Get-GitHubReleaseAssetByTag`, and `Get-GitHubReleaseAssetFromLatest`.
- Spelling corrections across 18 files in `.github/`, `examples/`,
`src/classes/`, `src/functions/`, and `tests/`.
---------
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: MariusStorhaug <17722253+MariusStorhaug@users.noreply.github.com>
Co-authored-by: Marius Storhaug <marstor@hotmail.com>1 parent 39b98ce commit a489f06
26 files changed
Lines changed: 108 additions & 61 deletions
File tree
- .github
- examples
- src
- classes/public
- Releases
- Repositories
- functions
- private
- Auth/DeviceFlow
- Enterprise
- Releases/Assets
- Repositories
- public
- API
- Actions/Data
- Commands
- Releases
- Repositories/Repositories
- Status
- tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| |||
173 | 173 | | |
174 | 174 | | |
175 | 175 | | |
176 | | - | |
| 176 | + | |
177 | 177 | | |
178 | 178 | | |
179 | 179 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
| 18 | + | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
| 21 | + | |
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
| 20 | + | |
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
182 | 182 | | |
183 | 183 | | |
184 | 184 | | |
185 | | - | |
| 185 | + | |
186 | 186 | | |
187 | 187 | | |
188 | 188 | | |
| |||
242 | 242 | | |
243 | 243 | | |
244 | 244 | | |
245 | | - | |
| 245 | + | |
246 | 246 | | |
247 | 247 | | |
248 | 248 | | |
| |||
298 | 298 | | |
299 | 299 | | |
300 | 300 | | |
301 | | - | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
302 | 304 | | |
303 | 305 | | |
304 | 306 | | |
| |||
353 | 355 | | |
354 | 356 | | |
355 | 357 | | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
356 | 363 | | |
357 | 364 | | |
358 | 365 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
34 | | - | |
| 34 | + | |
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
| |||
Lines changed: 3 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
67 | 67 | | |
68 | 68 | | |
69 | 69 | | |
70 | | - | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
71 | 73 | | |
72 | 74 | | |
73 | 75 | | |
| |||
Lines changed: 7 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
115 | 115 | | |
116 | 116 | | |
117 | 117 | | |
118 | | - | |
119 | | - | |
120 | | - | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
121 | 125 | | |
122 | | - | |
123 | | - | |
124 | 126 | | |
125 | 127 | | |
126 | 128 | | |
| |||
Lines changed: 7 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
114 | 114 | | |
115 | 115 | | |
116 | 116 | | |
117 | | - | |
118 | | - | |
119 | | - | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
120 | 124 | | |
121 | | - | |
122 | | - | |
123 | 125 | | |
124 | 126 | | |
125 | 127 | | |
| |||
Lines changed: 4 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
78 | 78 | | |
79 | 79 | | |
80 | 80 | | |
81 | | - | |
82 | 81 | | |
83 | 82 | | |
84 | 83 | | |
| |||
128 | 127 | | |
129 | 128 | | |
130 | 129 | | |
131 | | - | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
132 | 134 | | |
133 | 135 | | |
134 | 136 | | |
| |||
0 commit comments