File tree Expand file tree Collapse file tree 1 file changed +20
-1
lines changed Expand file tree Collapse file tree 1 file changed +20
-1
lines changed Original file line number Diff line number Diff line change @@ -126,7 +126,26 @@ jobs:
126
126
- name : Reinstall GitHub module
127
127
shell : pwsh
128
128
run : |
129
- Install-PSResource -Name GitHub -TrustRepository -Reinstall
129
+ 'GitHub' | ForEach-Object {
130
+ $name = $_
131
+ Write-Output "Installing module: $name"
132
+ $retryCount = 5
133
+ $retryDelay = 10
134
+ for ($i = 0; $i -lt $retryCount; $i++) {
135
+ try {
136
+ Install-PSResource -Name $name -WarningAction SilentlyContinue -TrustRepository -Repository PSGallery -Reinstall
137
+ break
138
+ } catch {
139
+ Write-Warning "Installation of $name failed with error: $_"
140
+ if ($i -eq $retryCount - 1) {
141
+ throw
142
+ }
143
+ Write-Warning "Retrying in $retryDelay seconds..."
144
+ Start-Sleep -Seconds $retryDelay
145
+ }
146
+ }
147
+ Import-Module -Name $name
148
+ }
130
149
131
150
- name : Structure site
132
151
uses : PSModule/GitHub-Script@v1
You can’t perform that action at this time.
0 commit comments