You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Repository owners and automation workflows need to read and set custom property values on individual repositories. While property definitions are managed at the organization or enterprise level, values can be set at the repository level by repo admins or users with the edit custom property values permission. The module currently has Get-GitHubRepositoryCustomProperty but lacks the ability to set values, and the existing function needs integration tests.
Request
Desired capability
Complete repository-level custom property value management: get and set property values on individual repositories. The Get- function already exists but needs proper integration tests that own their lifecycle (create definitions at org level, set values, read back, validate types including multi-select array preservation, clean up). A Set- function is needed to assign or unset values.
Acceptance criteria
Set-GitHubRepositoryCustomProperty is implemented to create/update values on a single repo
Unsetting a property (setting value to null) is supported
All five value types work correctly: string, single_select, multi_select, true_false, url
Integration tests own their full lifecycle: create org-level definitions → set values on repo → read back → validate → update → unset → clean up definitions
Tests cover all five value types including multi-select array preservation
The existing Get-GitHubRepositoryCustomProperty function has proper test coverage
Setting value to null unsets (removes) the property from the repository.
Dependency on org-level definitions: Property values can only be set if the corresponding definition exists at the organization (or enterprise) level. Tests must first create definitions using the org-level functions from #587, then set and read values.
Class: The existing GitHubCustomProperty class handles the value response correctly (including multi-select array preservation from #577). No class changes needed.
Test approach: Integration tests in tests/Repositories.Tests.ps1 within the organization context (-Skip:($OwnerType -ne 'organization')). Tests require org-level property definitions as prerequisites, so they should:
Create org-level property definitions in BeforeAll (one of each type)
Set values on the test repository
Read back values using Get-GitHubRepositoryCustomProperty
Validate types (especially multi-select as [string[]])
Update values
Unset values using null
Remove org-level definitions in AfterAll
Note
This issue depends on #587 (Organization Custom Properties) for the org-level definition management functions used in test setup/cleanup. If #587 is not yet implemented, the test setup can use raw Invoke-GitHubAPI calls temporarily.
Implementation plan
Public functions
Set-GitHubRepositoryCustomProperty — create/update/unset values on a single repo (src/functions/public/Repositories/CustomProperties/)
Tests
Add repo custom property lifecycle test in tests/Repositories.Tests.ps1 (org context only)
BeforeAll: Create org-level property definitions (one of each type: string, single_select, multi_select, true_false, url)
Test Set-GitHubRepositoryCustomProperty — set string value, read back
Test Set-GitHubRepositoryCustomProperty — set single_select value, read back
Test Set-GitHubRepositoryCustomProperty — set multi_select value (array), read back, verify [string[]] type
Test Set-GitHubRepositoryCustomProperty — set true_false value, read back
Test Set-GitHubRepositoryCustomProperty — set url value, read back
Test Set-GitHubRepositoryCustomProperty — unset value with $null, verify removed
Test Get-GitHubRepositoryCustomProperty — validates all returned properties have correct Name and typed Value
Test Get-GitHubRepository.CustomProperties property — verify it populates from both REST and GraphQL paths
Repository owners and automation workflows need to read and set custom property values on individual repositories. While property definitions are managed at the organization or enterprise level, values can be set at the repository level by repo admins or users with the
edit custom property valuespermission. The module currently hasGet-GitHubRepositoryCustomPropertybut lacks the ability to set values, and the existing function needs integration tests.Request
Desired capability
Complete repository-level custom property value management: get and set property values on individual repositories. The
Get-function already exists but needs proper integration tests that own their lifecycle (create definitions at org level, set values, read back, validate types including multi-select array preservation, clean up). ASet-function is needed to assign or unset values.Acceptance criteria
Set-GitHubRepositoryCustomPropertyis implemented to create/update values on a single reponull) is supportedstring,single_select,multi_select,true_false,url[string[]]arrays (the fix from 🪲 [Fix]: Multi-select custom properties no longer lose individual values #577)Get-GitHubRepositoryCustomPropertyfunction has proper test coverageTechnical decisions
API choice: REST API. The repository custom properties endpoints provide get and set for values.
Endpoints:
GET/repos/{owner}/{repo}/properties/valuesGet-GitHubRepositoryCustomPropertyPATCH/repos/{owner}/{repo}/properties/valuesSet-GitHubRepositoryCustomPropertyPermissions required:
"Metadata" repository permissions (read)— works unauthenticated for public repos"Custom properties" repository permissions (write)Function placement:
src/functions/public/Repositories/CustomProperties/Set payload:
{ "properties": [ { "property_name": "environment", "value": "production" }, { "property_name": "topics", "value": ["api", "module", "automation"] }, { "property_name": "archived", "value": null } ] }Setting
valuetonullunsets (removes) the property from the repository.Dependency on org-level definitions: Property values can only be set if the corresponding definition exists at the organization (or enterprise) level. Tests must first create definitions using the org-level functions from #587, then set and read values.
Class: The existing
GitHubCustomPropertyclass handles the value response correctly (including multi-select array preservation from #577). No class changes needed.Test approach: Integration tests in
tests/Repositories.Tests.ps1within the organization context (-Skip:($OwnerType -ne 'organization')). Tests require org-level property definitions as prerequisites, so they should:BeforeAll(one of each type)Get-GitHubRepositoryCustomProperty[string[]])AfterAllNote
This issue depends on #587 (Organization Custom Properties) for the org-level definition management functions used in test setup/cleanup. If #587 is not yet implemented, the test setup can use raw
Invoke-GitHubAPIcalls temporarily.Implementation plan
Public functions
Set-GitHubRepositoryCustomProperty— create/update/unset values on a single repo (src/functions/public/Repositories/CustomProperties/)Tests
tests/Repositories.Tests.ps1(org context only)string,single_select,multi_select,true_false,url)Set-GitHubRepositoryCustomProperty— setstringvalue, read backSet-GitHubRepositoryCustomProperty— setsingle_selectvalue, read backSet-GitHubRepositoryCustomProperty— setmulti_selectvalue (array), read back, verify[string[]]typeSet-GitHubRepositoryCustomProperty— settrue_falsevalue, read backSet-GitHubRepositoryCustomProperty— seturlvalue, read backSet-GitHubRepositoryCustomProperty— unset value with$null, verify removedGet-GitHubRepositoryCustomProperty— validates all returned properties have correct Name and typed ValueGet-GitHubRepository.CustomPropertiesproperty — verify it populates from both REST and GraphQL pathsCleanup from #577
#SkipTest:FunctionTest:Will add a test for this function in a future PRannotation fromGet-GitHubRepositoryCustomProperty.ps1