-
Notifications
You must be signed in to change notification settings - Fork 2
31 lines (29 loc) · 1.01 KB
/
VarReuseInJobs.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
name: VarReuseInJobs
on: [workflow_dispatch]
jobs:
set_resource_group:
runs-on: ubuntu-latest
outputs:
rg_name: ${{ steps.set_rg.outputs.rg }}
steps:
- uses: actions/checkout@v4
- uses: azure/login@v2
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}
enable-AzPSSession: true
- name: Setup Azure PowerShell
id: set_rg
uses: azure/powershell@v2
with:
inlineScript: |
Write-Output "RG=$(Get-AzResourceGroup -Name GitHubAction24|ConvertTo-Json -Compress)" >> $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 }}"
Write-Host "Using Resource Group Name: $rgName"
shell: pwsh