Skip to content

Commit fc76b9b

Browse files
authored
ci: fix PowerShell .tar validation (#1505)
We saw that a .tar archive was corrupted with the warning "There are data after the archive [sic]". This seems like something transient, but validation didn't catch it. `tar -t {path}` will not work as expected (at least on Windows); it's needed to pass `f` to specify the file path. Otherwise tar falls back on `\\.\tape0)`(!). Regardless, when validating tar does not set a non-zero error code for this kind of issue. Instead, use `7z -t` which properly sets the error code and allows us to bail out.
1 parent fe1f372 commit fc76b9b

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

.github/workflows/package.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,12 @@ jobs:
260260
261261
# Verify the archive.
262262
Write-Host "Verify archive at $PSModuleTarFilePath"
263-
tar -t "$PSModuleTarFilePath"
263+
# tar -tvf "$PSModuleTarFilePath" | Out-Null
264+
& 7z t "$PSModuleTarFilePath"
265+
266+
if ($LASTEXITCODE -ne 0) {
267+
throw "tar verify failed: $PSModuleTarFilePath is invalid."
268+
}
264269
265270
Set-PSDebug -Off # Too many traces are logged when running New-ModulePackage.
266271
New-ModulePackage $DGatewayPSModulePath $PSModuleParentPath

0 commit comments

Comments
 (0)