Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
Ayanmullick committed Apr 8, 2024
1 parent 33250e6 commit 711365e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/VarReuseInJobs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
6 changes: 5 additions & 1 deletion GHActionTest/FuncVar.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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
#>

0 comments on commit 711365e

Please sign in to comment.