Skip to content

v0.42.0

Choose a tag to compare

@github-actions github-actions released this 26 Feb 00:06
· 8 commits to main since this release
32a9fc3

🚀 [Feature]: Custom properties now included in repository queries by default (#561)

Repository queries by name and by owner now return CustomProperties by default — no additional parameters needed. Fork listings now also return typed [GitHubRepository] objects instead of raw API responses, making them consistent with other repository commands.

New: Custom properties included in by-name and by-owner queries

Get-GitHubRepository now returns CustomProperties when querying by name or listing by owner, without needing -AdditionalProperty 'CustomProperties'.

# Both of these now include CustomProperties in the output:
Get-GitHubRepository -Owner 'myorg' -Name 'myrepo'
Get-GitHubRepository -Owner 'myorg'

Previously, these required an explicit parameter:

# Before: required -AdditionalProperty to get CustomProperties
Get-GitHubRepository -Owner 'myorg' -Name 'myrepo' -AdditionalProperty 'CustomProperties'

Changed: Fork listings return typed repository objects

Get-GitHubRepositoryFork now returns [GitHubRepository] objects instead of raw PSCustomObject responses. This means fork listings include all typed properties (including CustomProperties), consistent with other repository commands.

$forks = Get-GitHubRepositoryFork -Owner 'octocat' -Name 'Hello-World'
$forks[0].GetType().Name  # GitHubRepository (was PSCustomObject)

Technical Details

  • Added 'CustomProperties' to the default $Property array in two private GraphQL functions: Get-GitHubRepositoryByName and Get-GitHubRepositoryListByOwner. This causes the GraphQL query to include the repositoryCustomPropertyValues(first: 100) { nodes { propertyName value } } sub-query by default.
  • Get-GitHubMyRepositories and Get-GitHubMyRepositoryByName were initially updated but reverted — these authenticated-user queries do not need the change.
  • Updated Get-GitHubRepositoryFork to cast each response item via [GitHubRepository]::new($repo) and added [OutputType([GitHubRepository])], matching the pattern used by Get-GitHubRepositoryListByTeam.
  • No changes to the GitHubRepository class — it already supports both REST (custom_properties) and GraphQL (repositoryCustomPropertyValues.nodes) formats in its constructors.