From 711365e5197b45a79b4bf5e2a4045b2ab29ec285 Mon Sep 17 00:00:00 2001 From: Ayan Date: Sun, 7 Apr 2024 22:26:21 -0500 Subject: [PATCH] . --- .github/workflows/VarReuseInJobs.yml | 4 +++- GHActionTest/FuncVar.ps1 | 6 +++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/VarReuseInJobs.yml b/.github/workflows/VarReuseInJobs.yml index 8d6b5d2..bfb871d 100644 --- a/.github/workflows/VarReuseInJobs.yml +++ b/.github/workflows/VarReuseInJobs.yml @@ -17,7 +17,9 @@ jobs: uses: azure/powershell@v2 with: inlineScript: | - Write-Output "RG=$(Get-AzResourceGroup -Name GitHubAction24|ConvertTo-Json -Compress)" >> $Env:GITHUB_OUTPUT + $RG = Get-AzResourceGroup -Name GitHubAction24 -Verbose + $rgName = $RG.ResourceGroupName + Write-Output "rg_name=$rgName" >> $Env:GITHUB_OUTPUT azPSVersion: 'latest' use_resource_group: diff --git a/GHActionTest/FuncVar.ps1 b/GHActionTest/FuncVar.ps1 index 28012d2..b3d6d58 100644 --- a/GHActionTest/FuncVar.ps1 +++ b/GHActionTest/FuncVar.ps1 @@ -16,9 +16,13 @@ $RG = Get-AzResourceGroup -Name GitHubAction24 -Verbose $rgName = $RG.ResourceGroupName Write-Output "rg_name=$rgName" >> $Env:GITHUB_OUTPUT +Write-Output "RG=$(Get-AzResourceGroup -Name GitHubAction24|ConvertTo-Json -Compress)" >> $Env:GITHUB_OUTPUT #v2 + + + #Get $rgName = "${{ needs.set_resource_group.outputs.rg }}" Write-Host "Using Resource Group Name: $rgName" -$env:needs.set_resource_group.outputs.rg | ConvertFrom-Json +$env:needs.set_resource_group.outputs.rg | ConvertFrom-Json #v2 #> \ No newline at end of file