@@ -2,11 +2,16 @@ import { ChildProcess, spawn } from "child_process";
22import * as path from "path" ;
33
44import * as core from "@actions/core" ;
5+ import * as toolcache from "@actions/tool-cache" ;
56import { pki } from "node-forge" ;
67
78import * as actionsUtil from "./actions-util" ;
89import * as util from "./util" ;
910
11+ const UPDATEJOB_PROXY = "update-job-proxy" ;
12+ const UPDATEJOB_PROXY_VERSION = "v2.0.20240722180912" ;
13+ const UPDATEJOB_PROXY_URL =
14+ "https://github.com/github/codeql-action/releases/download/codeql-bundle-v2.18.1/update-job-proxy.tar.gz" ;
1015const PROXY_USER = "proxy_user" ;
1116const KEY_SIZE = 2048 ;
1217const KEY_EXPIRY_YEARS = 2 ;
@@ -106,7 +111,17 @@ async function runWrapper() {
106111 proxy_auth,
107112 } ;
108113 const host = "127.0.0.1" ;
109- const proxyBin = path . resolve ( __dirname , ".." , "bin" , "update-job-proxy" ) ;
114+ let proxyBin = toolcache . find ( UPDATEJOB_PROXY , UPDATEJOB_PROXY_VERSION ) ;
115+ if ( ! proxyBin ) {
116+ const temp = await toolcache . downloadTool ( UPDATEJOB_PROXY_URL ) ;
117+ const extracted = await toolcache . extractTar ( temp ) ;
118+ proxyBin = await toolcache . cacheDir (
119+ extracted ,
120+ UPDATEJOB_PROXY ,
121+ UPDATEJOB_PROXY_VERSION ,
122+ ) ;
123+ }
124+ proxyBin = path . join ( proxyBin , UPDATEJOB_PROXY ) ;
110125 let port = 49152 ;
111126 try {
112127 let subprocess : ChildProcess | undefined = undefined ;
0 commit comments