Repository navigation
Expand file tree
/
Copy pathaction.yml
More file actions
101 lines (86 loc) · 3.7 KB
/
Copy pathaction.yml
File metadata and controls
101 lines (86 loc) · 3.7 KB
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
name: 'Variables - Manage workflow variables'
description: 'Load variables to environment variables in runner'
branding:
icon: 'cloud-lightning'
color: 'red'
inputs:
Load:
description: 'Lists the environment variables on runner'
required: false
default: 'true'
List:
description: 'Lists the environment variables on runner'
required: false
default: 'false'
VariableFilePath:
description: 'Path to a variables json file. Default: env.VariableFilePath'
required: false
runs:
using: "composite"
steps:
- name: Download AzUtilities
shell: pwsh
run: |
Write-Output '::group::Download AzUtilities'
$env:PSModulePath -split $([System.IO.Path]::PathSeparator)
$InstallPath = $env:PSModulePath -split $([System.IO.Path]::PathSeparator) | Select-Object -First 1
if (! (Test-Path -Path $InstallPath)){
try {
Write-Output "$InstallPath not found, creating"
New-Item -Path $InstallPath -ItemType "directory" -Force | Out-Null
} catch {
throw "$InstallPath creating failed"
}
}
Write-Output "InstallPath: $InstallPath"
New-Item -Path "$InstallPath\Utils" -ItemType "directory" -Force | Out-Null
Invoke-WebRequest -OutFile "$InstallPath\Utils\Utils.psm1" -Uri "https://raw.githubusercontent.com/AzActions/AzUtilities/main/Modules/Utils/Utils.psm1"
Invoke-WebRequest -OutFile "$InstallPath\Utils\Utils.psd1" -Uri "https://raw.githubusercontent.com/AzActions/AzUtilities/main/Modules/Utils/Utils.psd1"
- id: VariablesLoad
shell: pwsh
run: |
New-GitHubLogGroup -Title "Variables-Load"
Write-Output '-------------------------------------------'
Write-Output 'Environment variables:'
$env = @{
Load = $env:Load | ConvertTo-Boolean
VariableFilePath = $env:VariableFilePath
}
$env.GetEnumerator() | Sort-Object -Property Name
Write-Output '-------------------------------------------'
Write-Output 'Action inputs:'
$inputs = @{
Load = '${{ inputs.Load }}' | ConvertTo-Boolean
VariableFilePath = '${{ inputs.VariableFilePath }}'
}
$inputs.GetEnumerator() | Sort-Object -Property Name
Write-Output '-------------------------------------------'
Write-Output 'Executing with:'
$Params = Merge-Hashtables -Main $env -Overrides $inputs
$Params.GetEnumerator() | Sort-Object -Property Name
. "$env:GITHUB_ACTION_PATH\Scripts\main.ps1" @Params
Write-Output '::endgroup::'
- id: VariablesList
shell: pwsh
run: |
New-GitHubLogGroup -Title "Variables-List"
Write-Output '-------------------------------------------'
Write-Output 'Environment variables:'
$env = @{
List = $env:List | ConvertTo-Boolean
VariableFilePath = $env:VariableFilePath
}
$env.GetEnumerator() | Sort-Object -Property Name
Write-Output '-------------------------------------------'
Write-Output 'Action inputs:'
$inputs = @{
List = '${{ inputs.List }}' | ConvertTo-Boolean
VariableFilePath = '${{ inputs.VariableFilePath }}'
}
$inputs.GetEnumerator() | Sort-Object -Property Name
Write-Output '-------------------------------------------'
Write-Output 'Executing with:'
$Params = Merge-Hashtables -Main $env -Overrides $inputs
$Params.GetEnumerator() | Sort-Object -Property Name
. "$env:GITHUB_ACTION_PATH\Scripts\main.ps1" @Params
Write-Output '::endgroup::'