Skip to content

Commit b8cdc93

Browse files
🩹 [Patch]: Enhance Import-GitHubEventData function; convert property names to PascalCase and store in a hashtable for improved structure
1 parent 4ff79f2 commit b8cdc93

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

‎src/functions/private/Actions/Import-GitHubEventData.ps1

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,15 @@
3535
$eventRepository = $gitHubEvent.repository | Select-Object -Property name, full_name, html_url, id, node_id, default_branch
3636

3737
$gitHubEvent = $gitHubEvent | Select-Object -ExcludeProperty action, sender, enterprise, organization, repository
38+
39+
$hashtable = @{}
40+
$gitHubEvent.PSObject.Properties | ForEach-Object {
41+
$name = $_.Name
42+
$name = $name | Convert-StringCasingStyle -To PascalCase
43+
$hashtable[$_.Name] = $_.Value
44+
}
45+
$gitHubEvent = [pscustomobject]$hashtable
46+
3847
$gitHubEvent | Add-Member -MemberType NoteProperty -Name Name -Value $env:GITHUB_EVENT_NAME -Force
3948
if ($eventAction) {
4049
$gitHubEvent | Add-Member -MemberType NoteProperty -Name Action -Value $eventAction -Force

0 commit comments

Comments
 (0)