@@ -319,95 +319,6 @@ jobs:
319319 }
320320 }
321321
322- ActionTestCompositeOutputs :
323- name : Composite Action Outputs Test
324- runs-on : ${{ inputs.runs-on }}
325- steps :
326- # Need to check out as part of the test, as its a local action
327- - name : Checkout repo
328- uses : actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
329- with :
330- persist-credentials : false
331-
332- # Test 1: Direct usage of GitHub-Script action
333- - name : Direct GitHub-Script Usage
334- id : direct-test
335- uses : ./
336- with :
337- Name : Direct-Usage-Test
338- Prerelease : ${{ inputs.Prerelease }}
339- ShowOutput : true
340- Script : |
341- Set-GitHubOutput -Name 'DirectOutput' -Value 'This is from direct usage'
342-
343- # Test 2: Nested usage via composite action
344- - name : Composite Action Usage
345- id : composite-test
346- uses : ./.github/actions/test-composite
347- with :
348- Prerelease : ${{ inputs.Prerelease }}
349-
350- # Test 3: Verify outputs work correctly
351- - name : Verify Outputs
352- shell : pwsh
353- env :
354- DIRECT_OUTPUT : >-
355- ${{ fromJson(steps.direct-test.outputs.result).DirectOutput }}
356- COMPOSITE_OUTPUT1 : >-
357- ${{ fromJson(steps.composite-test.outputs.result).TestOutput1 }}
358- COMPOSITE_OUTPUT2 : >-
359- ${{ fromJson(steps.composite-test.outputs.result).TestOutput2 }}
360- COMPOSITE_MESSAGE : >-
361- ${{ fromJson(steps.composite-test.outputs.result).CompositeMessage
362- }}
363- run : |
364- $PSStyle.OutputRendering = 'Ansi'
365-
366- LogGroup 'Verify Direct Output' {
367- Write-Host "Direct Output: $env:DIRECT_OUTPUT"
368- if ($env:DIRECT_OUTPUT -ne 'This is from direct usage') {
369- throw "Direct output verification failed"
370- }
371- Write-Host "✅ Direct output is correct"
372- }
373-
374- LogGroup 'Verify Composite Outputs' {
375- Write-Host "Composite Output 1: $env:COMPOSITE_OUTPUT1"
376- Write-Host "Composite Output 2: $env:COMPOSITE_OUTPUT2"
377- Write-Host "Composite Message: $env:COMPOSITE_MESSAGE"
378-
379- if ($env:COMPOSITE_OUTPUT1 -ne 'Value from composite action') {
380- throw "Composite output 1 verification failed"
381- }
382- $expectedMsg = 'This output is from a nested composite action'
383- if ($env:COMPOSITE_MESSAGE -ne $expectedMsg) {
384- throw "Composite message verification failed"
385- }
386- Write-Host "✅ Composite outputs are correct"
387- }
388-
389- LogGroup 'Test output access patterns' {
390- # Demonstrate the patterns shown in help text work correctly
391- # These patterns are used above in the env section
392- $directPattern = @'
393- ${{ fromJson(steps.direct-test.outputs.result).DirectOutput }}
394- '@
395- $compositePattern = @'
396- ${{ fromJson(steps.composite-test.outputs.result).TestOutput1 }}
397- '@
398- Write-Host "Direct access pattern: $directPattern"
399- Write-Host "Composite access pattern: $compositePattern"
400- Write-Host "✅ Both access patterns work correctly"
401- Write-Host "✅ Values retrieved successfully prove patterns work"
402- }
403-
404- # Test 4: Validate output help text format
405- - name : Validate Output Help Text Format
406- shell : pwsh
407- run : |
408- & ./tests/validate-output-help-text.ps1
409-
410-
411322 MatrixCreator :
412323 name : Matrix Creator
413324 runs-on : ubuntu-latest
0 commit comments