Skip to content

🪲 [Fix]: Multi-select custom properties no longer lose individual values#577

Draft
Marius Storhaug (MariusStorhaug) wants to merge 2 commits intomainfrom
fix/custom-property-multiselect-value
Draft

🪲 [Fix]: Multi-select custom properties no longer lose individual values#577
Marius Storhaug (MariusStorhaug) wants to merge 2 commits intomainfrom
fix/custom-property-multiselect-value

Conversation

@MariusStorhaug
Copy link
Copy Markdown
Member

@MariusStorhaug Marius Storhaug (MariusStorhaug) commented Apr 5, 2026

Multi-select custom property values are now correctly preserved as arrays. Previously, properties with multiple selections (e.g., ["Custom Instructions", "License", "Prompts"]) were silently collapsed into a single space-joined string ("Custom Instructions License Prompts"), making it impossible to iterate over individual selections downstream.

Fixed: Multi-select custom property values collapsed into a single string

Commands that return repository custom properties (such as Get-GitHubRepository and Get-GitHubRepositoryCustomProperty) now preserve array values for multi-select properties. Each selection is available as a separate string element, so downstream logic that iterates over values works correctly.

$repo = Get-GitHubRepository -Owner 'MyOrg' -Name 'MyRepo'
$repo.CustomProperties | Where-Object Name -EQ 'SubscribeTo'

# Before (broken):
# Name        Value
# ----        -----
# SubscribeTo Custom Instructions License Prompts

# After (correct):
# Name        Value
# ----        -----
# SubscribeTo {Custom Instructions, License, Prompts}

# Individual values are now accessible:
$prop.Value[0]  # "Custom Instructions"
$prop.Value[1]  # "License"
$prop.Value[2]  # "Prompts"

Single-select and text custom properties continue to work as before — their values remain plain strings.

Technical Details

  • GitHubCustomProperty.Value type changed from [string] to [object] to allow both scalar strings and string arrays.
  • The constructor now checks whether the raw value implements IEnumerable (excluding string). If so, it casts to [string[]]; otherwise it assigns the value directly.
  • Unit tests added covering multi-select array preservation, scalar string pass-through, and GraphQL-style property name resolution.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 5, 2026

Super-linter summary

Language Validation result
CHECKOV Pass ✅
GITHUB_ACTIONS Pass ✅
GITLEAKS Pass ✅
GIT_MERGE_CONFLICT_MARKERS Pass ✅
MARKDOWN Pass ✅
NATURAL_LANGUAGE Pass ✅
PRE_COMMIT Pass ✅
SPELL_CODESPELL Pass ✅
TRIVY Pass ✅
YAML Pass ✅

All files and directories linted successfully

For more information, see the GitHub Actions workflow run

Powered by Super-linter

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes a bug in the repository custom properties model where multi-select custom property values returned as arrays by the GitHub API were being coerced into a single space-joined string, preventing correct downstream iteration.

Changes:

  • Changed GitHubCustomProperty.Value from [string] to [object] to allow array values.
  • Updated the GitHubCustomProperty constructor to detect non-string enumerables and cast them to [string[]].

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 5, 2026

Super-linter summary

Language Validation result
CHECKOV Pass ✅
GITHUB_ACTIONS Pass ✅
GITLEAKS Pass ✅
GIT_MERGE_CONFLICT_MARKERS Pass ✅
MARKDOWN Pass ✅
NATURAL_LANGUAGE Pass ✅
PRE_COMMIT Pass ✅
SPELL_CODESPELL Pass ✅
TRIVY Pass ✅
YAML Pass ✅

All files and directories linted successfully

For more information, see the GitHub Actions workflow run

Powered by Super-linter

@MariusStorhaug Marius Storhaug (MariusStorhaug) changed the title 🐛 [Bug]: Preserve array values for multi-select custom properties 🪲 [Fix]: Multi-select custom properties no longer lose individual values Apr 5, 2026
@MariusStorhaug Marius Storhaug (MariusStorhaug) marked this pull request as draft April 5, 2026 11:53
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 5, 2026

Super-linter summary

Language Validation result
CHECKOV Pass ✅
GITHUB_ACTIONS Pass ✅
GITLEAKS Pass ✅
GIT_MERGE_CONFLICT_MARKERS Pass ✅
MARKDOWN Pass ✅
NATURAL_LANGUAGE Pass ✅
PRE_COMMIT Pass ✅
SPELL_CODESPELL Pass ✅
TRIVY Pass ✅
YAML Pass ✅

All files and directories linted successfully

For more information, see the GitHub Actions workflow run

Powered by Super-linter

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

2 participants