VarReuseInJobs #5
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: FuncVarReuseInJobs | |
on: [workflow_dispatch] | |
jobs: | |
set_resource_group: | |
runs-on: ubuntu-latest | |
outputs: | |
rg_name: ${{ steps.set_rg.outputs.rg_name }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: azure/login@v2 | |
with: | |
creds: ${{ secrets.AZURE_CREDENTIALS }} | |
enable-AzPSSession: true | |
- name: Setup Azure PowerShell | |
uses: azure/powershell@v2 | |
with: | |
inlineScript: | | |
$RG = Get-AzResourceGroup -Name GitHubAction24 -Verbose | |
$rgName = $RG.ResourceGroupName | |
$rgName | |
Write-Output "rg_name=$rgName" >> $Env:GITHUB_OUTPUT | |
azPSVersion: 'latest' | |
use_resource_group: | |
needs: set_resource_group | |
runs-on: ubuntu-latest | |
steps: | |
- name: Use RG Name | |
run: | | |
$rgName = "${{ needs.set_resource_group.outputs.rg_name }}" | |
Write-Host "Using Resource Group Name: $rgName" | |
shell: pwsh | |