File tree 5 files changed +37
-41
lines changed
5 files changed +37
-41
lines changed Original file line number Diff line number Diff line change 1
1
GITHUB_ACTOR = debugging
2
2
GITHUB_WORKSPACE = github_workspace
3
- GITHUB_OUTPUT = github_output_file
3
+ GITHUB_OUTPUT = github_output_file
4
+ DOCKER = false
Original file line number Diff line number Diff line change 1
1
FROM ghcr.io/rajbos/actions-marketplace/powershell:7
2
2
3
+ ENV DOCKER=true
4
+
3
5
COPY /Src/PowerShell/*.ps1 /src/
4
6
5
7
ENTRYPOINT ["pwsh" , "/src/entrypoint.ps1" ]
Original file line number Diff line number Diff line change @@ -76,6 +76,23 @@ function main {
76
76
Add-Content - Value " actions='$jsonObject '" - Path $env: GITHUB_OUTPUT
77
77
}
78
78
79
+ if (Get-Module - ListAvailable - Name " powershell-yaml" ) {
80
+ Write-Host " powershell-yaml Module exists"
81
+ }
82
+ else {
83
+ Write-Host " powershell-yaml Module does not exist"
84
+ Write-Host " Installing module for the yaml parsing"
85
+ Install-Module - Name $moduleName - Force - Scope CurrentUser - AllowClobber
86
+ }
87
+
88
+ try {
89
+ Import-Module powershell- yaml - Force
90
+ }
91
+ catch {
92
+ Write-Error " Error importing the powershell-yaml module"
93
+ throw
94
+ }
95
+
79
96
$currentLocation = Get-Location
80
97
try {
81
98
# always run in the correct location, where our scripts are located:
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 9
9
10
10
# pull in central calls library
11
11
. $PSScriptRoot \github- calls.ps1
12
- . $PSScriptRoot \generic.ps1
13
12
14
13
Write-Host " We're running with these parameters:"
15
14
Write-Host " - PAT.Length: [$ ( $PAT.Length ) ]"
@@ -35,7 +34,19 @@ function GetActionsFromWorkflow {
35
34
)
36
35
37
36
# parse the workflow file and extract the actions used in it
38
- $parsedYaml = ConvertFrom-Yaml $workflow
37
+ $parsedYaml = " "
38
+ try {
39
+ $parsedYaml = ConvertFrom-Yaml $workflow
40
+ }
41
+ catch {
42
+ Write-Warning " Error parsing the yaml from this workflow file: [$workflowFileName ] in repo: [$repo ]"
43
+ Write-Warning " Workflow content:"
44
+ Write-Warning $workflow
45
+ Write-Warning " "
46
+ Write-Warning " Error:"
47
+ Write-Warning $_
48
+ return
49
+ }
39
50
40
51
# create hastable
41
52
$actions = @ ()
@@ -112,11 +123,12 @@ function GetAllUsedActionsFromRepo {
112
123
}
113
124
}
114
125
catch {
115
- Write-Warning " Error handling this workflow file:"
116
- Write-Host $workflowFile.Replace ($PAT , " ****" ) | ConvertFrom-Json - Depth 10
126
+ Write-Warning " Error handling this workflow file [ $ ( $workflowFile .name ) ] in repo [ $repo ] :"
127
+ Write-Host ( $workflowFile | ConvertFrom-Json - Depth 10 ) .Replace($PAT , " ****" )
117
128
Write-Warning " ----------------------------------"
118
129
Write-Host " Error: [$_ ]"
119
130
Write-Warning " ----------------------------------"
131
+ continue
120
132
}
121
133
}
122
134
You can’t perform that action at this time.
0 commit comments