Skip to content

Commit 86c35ee

Browse files
🩹 [Patch]: Add tests to verify that Get/Set-GitHubOutput handles objects and hashtables (#21)
## Description This pull request adds tests for the Get/Set-GitHubOutput function to validate that they manage objects and hashtables as expected. ### Improvements to logging and output settings: * Added new log groups to set outputs for `Context` and `GitConfig` in the workflow. * Modified existing log group names to include hyphens for better readability. ## Type of change <!-- Use the check-boxes [x] on the options that are relevant. --> - [ ] 📖 [Docs] - [ ] 🪲 [Fix] - [x] 🩹 [Patch] - [ ] ⚠️ [Security fix] - [ ] 🚀 [Feature] - [ ] 🌟 [Breaking change] ## Checklist <!-- Use the check-boxes [x] on the options that are relevant. --> - [x] I have performed a self-review of my own code - [x] I have commented my code, particularly in hard-to-understand areas
1 parent 2525784 commit 86c35ee

File tree

1 file changed

+17
-2
lines changed

1 file changed

+17
-2
lines changed

.github/workflows/TestWorkflow.yml

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,14 +92,26 @@ jobs:
9292
Set-GitHubEnvironmentVariable -Name 'OCTOCAT' -Value $cat
9393
}
9494
95-
LogGroup 'Set outputs WISECAT' {
95+
LogGroup 'Set outputs - WISECAT' {
9696
Set-GitHubOutput -Name 'WISECAT' -Value $cat
9797
}
9898
99-
LogGroup 'Set outputs Zen' {
99+
LogGroup 'Set outputs - Zen' {
100100
Set-GitHubOutput -Name 'Zen' -Value $zen
101101
}
102102
103+
LogGroup 'Set outputs - Context' {
104+
Set-GitHubOutput -Name 'Context' -Value (Get-GitHubContext)
105+
}
106+
107+
LogGroup 'Set outputs - GitConfig' {
108+
Set-GitHubOutput -Name 'GitConfig' -Value (Get-GitHubGitConfig | Where-Object { $_.Name -in 'user.name','user.email' })
109+
}
110+
111+
LogGroup 'Set outputs - Zen2' {
112+
Set-GitHubOutput -Name 'Zen2' -Value $zen
113+
}
114+
103115
- name: Run-test
104116
shell: pwsh
105117
env:
@@ -109,6 +121,9 @@ jobs:
109121
$result = $env:result | ConvertFrom-Json
110122
Set-GitHubStepSummary -Summary $env:WISECAT
111123
Write-GitHubNotice -Message $result.Zen -Title 'GitHub Zen'
124+
Write-Host ($result.Zen2)
125+
$result.Context | Format-List
126+
$result.GitConfig | Format-List
112127
113128
ActionTestWithoutToken:
114129
name: WithoutToken

0 commit comments

Comments
 (0)