@@ -5,6 +5,7 @@ import * as path from "path";
55import { performance } from "perf_hooks" ;
66
77import * as core from "@actions/core" ;
8+ import * as toolrunner from "@actions/exec/lib/toolrunner" ;
89import { HttpClient } from "@actions/http-client" ;
910import * as toolcache from "@actions/tool-cache" ;
1011import { https } from "follow-redirects" ;
@@ -148,6 +149,39 @@ export async function downloadAndExtract(
148149 ) } ).`,
149150 ) ;
150151
152+ // Add the following log to display the size of the downloaded bundle
153+ const bundleSize = fs . statSync ( archivedBundlePath ) . size ;
154+ logger . info ( `Size of the downloaded CodeQL bundle: ${ bundleSize } bytes` ) ;
155+
156+ // Run `zstd -t` on the CodeQL bundle and log the results
157+ let stdout = "" ;
158+ let stderr = "" ;
159+ try {
160+ const zstdTestRunner = new toolrunner . ToolRunner (
161+ "zstd" ,
162+ [ "-t" , archivedBundlePath ] ,
163+ {
164+ silent : true ,
165+ listeners : {
166+ stdout : ( data : Buffer ) => {
167+ stdout += data . toString ( ) ;
168+ } ,
169+ stderr : ( data : Buffer ) => {
170+ stderr += data . toString ( ) ;
171+ } ,
172+ } ,
173+ } ,
174+ ) ;
175+ const exitCode = await zstdTestRunner . exec ( ) ;
176+ logger . info ( `zstd -t exited with code ${ exitCode } .` ) ;
177+ } catch ( error ) {
178+ logger . warning (
179+ `Failed to verify the integrity of the CodeQL bundle using zstd: ${ error } ` ,
180+ ) ;
181+ }
182+ logger . info ( `zstd -t stdout: ${ stdout } ` ) ;
183+ logger . info ( `zstd -t stderr: ${ stderr } ` ) ;
184+
151185 let extractionDurationMs : number ;
152186
153187 try {
0 commit comments