@@ -194,12 +194,39 @@ jobs:
194
194
- Test-ModuleLocal
195
195
steps :
196
196
- name : Status
197
- shell : pwsh
198
- run : |
199
- [pscustomobject]@{
200
- TestModule = '${{ needs.Test-Module.result }}'
201
- TestModuleLocal = '${{ needs.Test-ModuleLocal.result }}'
202
- }
197
+ uses : PSModule/GitHub-Script@v1
198
+ with :
199
+ Debug : ${{ inputs.Debug }}
200
+ Prerelease : ${{ inputs.Prerelease }}
201
+ Verbose : ${{ inputs.Verbose }}
202
+ Version : ${{ inputs.Version }}
203
+ WorkingDirectory : ${{ inputs.WorkingDirectory }}
204
+ Script : |
205
+ $repository = $env:GITHUB_REPOSITORY
206
+ $runId = $env:GITHUB_RUN_ID
207
+ $OutputPath = "./CodeCoverageArtifacts"
208
+ New-Item -ItemType Directory -Path $OutputPath | Out-Null
209
+ $artifactsJson = gh api "repos/$repository/actions/runs/$runId/artifacts" | ConvertFrom-Json
210
+ foreach ($artifact in $artifactsJson.artifacts) {
211
+ if ($artifact.name -like "*CodeCoverage") {
212
+ $zipPath = Join-Path $OutputPath "$($artifact.name).zip"
213
+
214
+ Write-Host "Downloading artifact '$($artifact.name)'..."
215
+ gh api `
216
+ --method GET `
217
+ -H "Accept: application/vnd.github+json" `
218
+ "/repos/$repository/actions/artifacts/$($artifact.id)/zip" `
219
+ --output $zipPath
220
+
221
+ # Extract the artifact
222
+ Write-Host "Extracting artifact '$($artifact.name)'..."
223
+ Expand-Archive -Path $zipPath -DestinationPath (Join-Path $OutputPath $artifact.name) -Force
224
+
225
+ # Optionally remove the zip after extraction
226
+ Remove-Item $zipPath -Force
227
+ }
228
+ }
229
+ Get-ChildItem -Path $OutputPath -Recurse
203
230
204
231
# TestModuleStatus:
205
232
# name: Test module status
0 commit comments