Skip to content

v0.41.0

Choose a tag to compare

@github-actions github-actions released this 22 Feb 15:29
· 8 commits to main since this release
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.

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.

$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/.