From bbfafc70beb10b602424f7a5f36d116706005bef Mon Sep 17 00:00:00 2001 From: Erika Gressi Date: Tue, 8 Nov 2022 19:46:42 +0100 Subject: [PATCH 1/6] echo to env gh output --- .github/actions/templates/getModuleTestFiles/action.yml | 3 ++- .github/actions/templates/getWorkflowInput/action.yml | 3 ++- .../templates/validateModuleDeployment/action.yml | 9 ++++++--- .../actions/templates/validateModulePester/action.yml | 3 ++- 4 files changed, 12 insertions(+), 6 deletions(-) diff --git a/.github/actions/templates/getModuleTestFiles/action.yml b/.github/actions/templates/getModuleTestFiles/action.yml index f842952d39..3b7fb77808 100644 --- a/.github/actions/templates/getModuleTestFiles/action.yml +++ b/.github/actions/templates/getModuleTestFiles/action.yml @@ -39,5 +39,6 @@ runs: $compressedOutput = "[$compressedOutput]" } Write-Verbose "Publishing output: $compressedOutput" -Verbose - Write-Output "::set-output name=moduleTestFilePaths::$compressedOutput" + # Write-Output "::set-output name=moduleTestFilePaths::$compressedOutput" + echo "moduleTestFilePaths=$compressedOutput" >> $env:GITHUB_OUTPUT Write-Output '::endgroup::' diff --git a/.github/actions/templates/getWorkflowInput/action.yml b/.github/actions/templates/getWorkflowInput/action.yml index 6ddd2ba62c..d9b4047524 100644 --- a/.github/actions/templates/getWorkflowInput/action.yml +++ b/.github/actions/templates/getWorkflowInput/action.yml @@ -80,7 +80,8 @@ runs: } # Output values to be accessed by next jobs - Write-Output "::set-output name=removeDeployment::$removeDeployment" + # Write-Output "::set-output name=removeDeployment::$removeDeployment" + echo "removeDeployment=$removeDeployment" >> $env:GITHUB_OUTPUT Write-Output '::endgroup::' shell: pwsh diff --git a/.github/actions/templates/validateModuleDeployment/action.yml b/.github/actions/templates/validateModuleDeployment/action.yml index abdab684d0..d70e8e4dde 100644 --- a/.github/actions/templates/validateModuleDeployment/action.yml +++ b/.github/actions/templates/validateModuleDeployment/action.yml @@ -345,19 +345,22 @@ runs: $res = New-TemplateDeployment @functionInput -Verbose # Get deployment name - Write-Output ('::set-output name={0}::{1}' -f 'deploymentName', $res.deploymentName) + # Write-Output ('::set-output name={0}::{1}' -f 'deploymentName', $res.deploymentName) + echo "deploymentName=$res.deploymentName" >> $env:GITHUB_OUTPUT # Populate further outputs $deploymentOutputHash = @{} foreach ($outputKey in $res.deploymentOutput.Keys) { - Write-Output ('::set-output name={0}::{1}' -f $outputKey, $res.deploymentOutput[$outputKey].Value) + # Write-Output ('::set-output name={0}::{1}' -f $outputKey, $res.deploymentOutput[$outputKey].Value) + echo "outputKey=$res.deploymentOutput[$outputKey].Value" >> $env:GITHUB_OUTPUT $deploymentOutputHash.add($outputKey, $res.deploymentOutput[$outputKey].Value) } $deploymentOutput = $deploymentOutputHash | ConvertTo-Json -Compress -Depth 100 Write-Verbose "Deployment output: $deploymentOutput" -Verbose - Write-Output ('::set-output name={0}::{1}' -f 'deploymentOutput', $deploymentOutput) + # Write-Output ('::set-output name={0}::{1}' -f 'deploymentOutput', $deploymentOutput) + echo "deploymentOutput=$deploymentOutput" >> $env:GITHUB_OUTPUT if ($res.ContainsKey('exception')) { # Happens only if there is an exception diff --git a/.github/actions/templates/validateModulePester/action.yml b/.github/actions/templates/validateModulePester/action.yml index 2677bc3d78..3459831223 100644 --- a/.github/actions/templates/validateModulePester/action.yml +++ b/.github/actions/templates/validateModulePester/action.yml @@ -118,7 +118,8 @@ runs: $outputPathFile = 'testResults.xml' $outputPath = Join-Path $outputPathDirectory $outputPathFile Write-Verbose "Pester tests output: $outputPath" -Verbose - Write-Output ('::set-output name={0}::{1}' -f 'outputPath', $outputPath) + # Write-Output ('::set-output name={0}::{1}' -f 'outputPath', $outputPath) + echo "outputPath=$outputPath" >> $env:GITHUB_OUTPUT # --------------------- # # Invoke Pester test(s) # From 0b57565532f97c6dad6963b7b1d615f12c743bb9 Mon Sep 17 00:00:00 2001 From: Erika Gressi Date: Tue, 8 Nov 2022 19:58:40 +0100 Subject: [PATCH 2/6] cleanup --- .github/actions/templates/getModuleTestFiles/action.yml | 1 - .github/actions/templates/getWorkflowInput/action.yml | 1 - .github/actions/templates/validateModuleDeployment/action.yml | 3 --- .github/actions/templates/validateModulePester/action.yml | 1 - 4 files changed, 6 deletions(-) diff --git a/.github/actions/templates/getModuleTestFiles/action.yml b/.github/actions/templates/getModuleTestFiles/action.yml index 3b7fb77808..fd623ba006 100644 --- a/.github/actions/templates/getModuleTestFiles/action.yml +++ b/.github/actions/templates/getModuleTestFiles/action.yml @@ -39,6 +39,5 @@ runs: $compressedOutput = "[$compressedOutput]" } Write-Verbose "Publishing output: $compressedOutput" -Verbose - # Write-Output "::set-output name=moduleTestFilePaths::$compressedOutput" echo "moduleTestFilePaths=$compressedOutput" >> $env:GITHUB_OUTPUT Write-Output '::endgroup::' diff --git a/.github/actions/templates/getWorkflowInput/action.yml b/.github/actions/templates/getWorkflowInput/action.yml index d9b4047524..e23b2cfa30 100644 --- a/.github/actions/templates/getWorkflowInput/action.yml +++ b/.github/actions/templates/getWorkflowInput/action.yml @@ -80,7 +80,6 @@ runs: } # Output values to be accessed by next jobs - # Write-Output "::set-output name=removeDeployment::$removeDeployment" echo "removeDeployment=$removeDeployment" >> $env:GITHUB_OUTPUT Write-Output '::endgroup::' diff --git a/.github/actions/templates/validateModuleDeployment/action.yml b/.github/actions/templates/validateModuleDeployment/action.yml index d70e8e4dde..7b03ddbea4 100644 --- a/.github/actions/templates/validateModuleDeployment/action.yml +++ b/.github/actions/templates/validateModuleDeployment/action.yml @@ -345,21 +345,18 @@ runs: $res = New-TemplateDeployment @functionInput -Verbose # Get deployment name - # Write-Output ('::set-output name={0}::{1}' -f 'deploymentName', $res.deploymentName) echo "deploymentName=$res.deploymentName" >> $env:GITHUB_OUTPUT # Populate further outputs $deploymentOutputHash = @{} foreach ($outputKey in $res.deploymentOutput.Keys) { - # Write-Output ('::set-output name={0}::{1}' -f $outputKey, $res.deploymentOutput[$outputKey].Value) echo "outputKey=$res.deploymentOutput[$outputKey].Value" >> $env:GITHUB_OUTPUT $deploymentOutputHash.add($outputKey, $res.deploymentOutput[$outputKey].Value) } $deploymentOutput = $deploymentOutputHash | ConvertTo-Json -Compress -Depth 100 Write-Verbose "Deployment output: $deploymentOutput" -Verbose - # Write-Output ('::set-output name={0}::{1}' -f 'deploymentOutput', $deploymentOutput) echo "deploymentOutput=$deploymentOutput" >> $env:GITHUB_OUTPUT if ($res.ContainsKey('exception')) { diff --git a/.github/actions/templates/validateModulePester/action.yml b/.github/actions/templates/validateModulePester/action.yml index 3459831223..52c0c814b6 100644 --- a/.github/actions/templates/validateModulePester/action.yml +++ b/.github/actions/templates/validateModulePester/action.yml @@ -118,7 +118,6 @@ runs: $outputPathFile = 'testResults.xml' $outputPath = Join-Path $outputPathDirectory $outputPathFile Write-Verbose "Pester tests output: $outputPath" -Verbose - # Write-Output ('::set-output name={0}::{1}' -f 'outputPath', $outputPath) echo "outputPath=$outputPath" >> $env:GITHUB_OUTPUT # --------------------- # From fd075f107b604e47d15b1efc0081ed604b689a16 Mon Sep 17 00:00:00 2001 From: Erika Gressi Date: Tue, 8 Nov 2022 23:44:02 +0100 Subject: [PATCH 3/6] access echo value --- .github/actions/templates/validateModuleDeployment/action.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/actions/templates/validateModuleDeployment/action.yml b/.github/actions/templates/validateModuleDeployment/action.yml index 7b03ddbea4..19f2c54141 100644 --- a/.github/actions/templates/validateModuleDeployment/action.yml +++ b/.github/actions/templates/validateModuleDeployment/action.yml @@ -345,13 +345,13 @@ runs: $res = New-TemplateDeployment @functionInput -Verbose # Get deployment name - echo "deploymentName=$res.deploymentName" >> $env:GITHUB_OUTPUT + echo "deploymentName=$($res.deploymentName)" >> $env:GITHUB_OUTPUT # Populate further outputs $deploymentOutputHash = @{} foreach ($outputKey in $res.deploymentOutput.Keys) { - echo "outputKey=$res.deploymentOutput[$outputKey].Value" >> $env:GITHUB_OUTPUT + echo "outputKey=$($res.deploymentOutput[$outputKey].Value)" >> $env:GITHUB_OUTPUT $deploymentOutputHash.add($outputKey, $res.deploymentOutput[$outputKey].Value) } From 449e595d606de1330735929474b582dcb334dbae Mon Sep 17 00:00:00 2001 From: Erika Gressi Date: Tue, 8 Nov 2022 23:46:36 +0100 Subject: [PATCH 4/6] writeout test --- .github/actions/templates/getModuleTestFiles/action.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/actions/templates/getModuleTestFiles/action.yml b/.github/actions/templates/getModuleTestFiles/action.yml index fd623ba006..1b4f483788 100644 --- a/.github/actions/templates/getModuleTestFiles/action.yml +++ b/.github/actions/templates/getModuleTestFiles/action.yml @@ -39,5 +39,6 @@ runs: $compressedOutput = "[$compressedOutput]" } Write-Verbose "Publishing output: $compressedOutput" -Verbose - echo "moduleTestFilePaths=$compressedOutput" >> $env:GITHUB_OUTPUT + # echo "moduleTestFilePaths=$compressedOutput" >> $env:GITHUB_OUTPUT + Write-Output ('{0}={1}' -f 'moduleTestFilePaths', $compressedOutput) >> $env:GITHUB_OUTPUT Write-Output '::endgroup::' From 93606490d741730eeb1db19c2a99c210f2f57aaf Mon Sep 17 00:00:00 2001 From: Erika Gressi Date: Tue, 8 Nov 2022 23:56:58 +0100 Subject: [PATCH 5/6] writeout all --- .github/actions/templates/getWorkflowInput/action.yml | 3 ++- .../templates/validateModuleDeployment/action.yml | 9 ++++++--- .../actions/templates/validateModulePester/action.yml | 3 ++- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/.github/actions/templates/getWorkflowInput/action.yml b/.github/actions/templates/getWorkflowInput/action.yml index e23b2cfa30..6114516a08 100644 --- a/.github/actions/templates/getWorkflowInput/action.yml +++ b/.github/actions/templates/getWorkflowInput/action.yml @@ -80,7 +80,8 @@ runs: } # Output values to be accessed by next jobs - echo "removeDeployment=$removeDeployment" >> $env:GITHUB_OUTPUT + # echo "removeDeployment=$removeDeployment" >> $env:GITHUB_OUTPUT + Write-Output ('{0}={1}' -f 'removeDeployment', $removeDeployment) >> $env:GITHUB_OUTPUT Write-Output '::endgroup::' shell: pwsh diff --git a/.github/actions/templates/validateModuleDeployment/action.yml b/.github/actions/templates/validateModuleDeployment/action.yml index 19f2c54141..db5964db44 100644 --- a/.github/actions/templates/validateModuleDeployment/action.yml +++ b/.github/actions/templates/validateModuleDeployment/action.yml @@ -345,19 +345,22 @@ runs: $res = New-TemplateDeployment @functionInput -Verbose # Get deployment name - echo "deploymentName=$($res.deploymentName)" >> $env:GITHUB_OUTPUT + # echo "deploymentName=$($res.deploymentName)" >> $env:GITHUB_OUTPUT + Write-Output ('{0}={1}' -f 'deploymentName', $res.deploymentName) >> $env:GITHUB_OUTPUT # Populate further outputs $deploymentOutputHash = @{} foreach ($outputKey in $res.deploymentOutput.Keys) { - echo "outputKey=$($res.deploymentOutput[$outputKey].Value)" >> $env:GITHUB_OUTPUT + # echo "outputKey=$($res.deploymentOutput[$outputKey].Value)" >> $env:GITHUB_OUTPUT + Write-Output ('{0}={1}' -f 'outputKey', $res.deploymentOutput[$outputKey].Value) >> $env:GITHUB_OUTPUT $deploymentOutputHash.add($outputKey, $res.deploymentOutput[$outputKey].Value) } $deploymentOutput = $deploymentOutputHash | ConvertTo-Json -Compress -Depth 100 Write-Verbose "Deployment output: $deploymentOutput" -Verbose - echo "deploymentOutput=$deploymentOutput" >> $env:GITHUB_OUTPUT + # echo "deploymentOutput=$deploymentOutput" >> $env:GITHUB_OUTPUT + Write-Output ('{0}={1}' -f 'deploymentOutput', $deploymentOutput) >> $env:GITHUB_OUTPUT if ($res.ContainsKey('exception')) { # Happens only if there is an exception diff --git a/.github/actions/templates/validateModulePester/action.yml b/.github/actions/templates/validateModulePester/action.yml index 52c0c814b6..0148830701 100644 --- a/.github/actions/templates/validateModulePester/action.yml +++ b/.github/actions/templates/validateModulePester/action.yml @@ -118,7 +118,8 @@ runs: $outputPathFile = 'testResults.xml' $outputPath = Join-Path $outputPathDirectory $outputPathFile Write-Verbose "Pester tests output: $outputPath" -Verbose - echo "outputPath=$outputPath" >> $env:GITHUB_OUTPUT + # echo "outputPath=$outputPath" >> $env:GITHUB_OUTPUT + Write-Output ('{0}={1}' -f 'outputPath', $outputPath) >> $env:GITHUB_OUTPUT # --------------------- # # Invoke Pester test(s) # From 3f6803b1a64f728dc4639554e56f88e0ac569e27 Mon Sep 17 00:00:00 2001 From: Erika Gressi Date: Wed, 9 Nov 2022 00:06:46 +0100 Subject: [PATCH 6/6] cleanup --- .github/actions/templates/getModuleTestFiles/action.yml | 1 - .github/actions/templates/getWorkflowInput/action.yml | 1 - .github/actions/templates/validateModuleDeployment/action.yml | 3 --- .github/actions/templates/validateModulePester/action.yml | 1 - 4 files changed, 6 deletions(-) diff --git a/.github/actions/templates/getModuleTestFiles/action.yml b/.github/actions/templates/getModuleTestFiles/action.yml index 1b4f483788..1cce2fb82e 100644 --- a/.github/actions/templates/getModuleTestFiles/action.yml +++ b/.github/actions/templates/getModuleTestFiles/action.yml @@ -39,6 +39,5 @@ runs: $compressedOutput = "[$compressedOutput]" } Write-Verbose "Publishing output: $compressedOutput" -Verbose - # echo "moduleTestFilePaths=$compressedOutput" >> $env:GITHUB_OUTPUT Write-Output ('{0}={1}' -f 'moduleTestFilePaths', $compressedOutput) >> $env:GITHUB_OUTPUT Write-Output '::endgroup::' diff --git a/.github/actions/templates/getWorkflowInput/action.yml b/.github/actions/templates/getWorkflowInput/action.yml index 6114516a08..af96c87aee 100644 --- a/.github/actions/templates/getWorkflowInput/action.yml +++ b/.github/actions/templates/getWorkflowInput/action.yml @@ -80,7 +80,6 @@ runs: } # Output values to be accessed by next jobs - # echo "removeDeployment=$removeDeployment" >> $env:GITHUB_OUTPUT Write-Output ('{0}={1}' -f 'removeDeployment', $removeDeployment) >> $env:GITHUB_OUTPUT Write-Output '::endgroup::' diff --git a/.github/actions/templates/validateModuleDeployment/action.yml b/.github/actions/templates/validateModuleDeployment/action.yml index db5964db44..b13b11bea8 100644 --- a/.github/actions/templates/validateModuleDeployment/action.yml +++ b/.github/actions/templates/validateModuleDeployment/action.yml @@ -345,21 +345,18 @@ runs: $res = New-TemplateDeployment @functionInput -Verbose # Get deployment name - # echo "deploymentName=$($res.deploymentName)" >> $env:GITHUB_OUTPUT Write-Output ('{0}={1}' -f 'deploymentName', $res.deploymentName) >> $env:GITHUB_OUTPUT # Populate further outputs $deploymentOutputHash = @{} foreach ($outputKey in $res.deploymentOutput.Keys) { - # echo "outputKey=$($res.deploymentOutput[$outputKey].Value)" >> $env:GITHUB_OUTPUT Write-Output ('{0}={1}' -f 'outputKey', $res.deploymentOutput[$outputKey].Value) >> $env:GITHUB_OUTPUT $deploymentOutputHash.add($outputKey, $res.deploymentOutput[$outputKey].Value) } $deploymentOutput = $deploymentOutputHash | ConvertTo-Json -Compress -Depth 100 Write-Verbose "Deployment output: $deploymentOutput" -Verbose - # echo "deploymentOutput=$deploymentOutput" >> $env:GITHUB_OUTPUT Write-Output ('{0}={1}' -f 'deploymentOutput', $deploymentOutput) >> $env:GITHUB_OUTPUT if ($res.ContainsKey('exception')) { diff --git a/.github/actions/templates/validateModulePester/action.yml b/.github/actions/templates/validateModulePester/action.yml index 0148830701..6f2a489539 100644 --- a/.github/actions/templates/validateModulePester/action.yml +++ b/.github/actions/templates/validateModulePester/action.yml @@ -118,7 +118,6 @@ runs: $outputPathFile = 'testResults.xml' $outputPath = Join-Path $outputPathDirectory $outputPathFile Write-Verbose "Pester tests output: $outputPath" -Verbose - # echo "outputPath=$outputPath" >> $env:GITHUB_OUTPUT Write-Output ('{0}={1}' -f 'outputPath', $outputPath) >> $env:GITHUB_OUTPUT # --------------------- #