@@ -2,11 +2,16 @@ import { ChildProcess, spawn } from "child_process";
2
2
import * as path from "path" ;
3
3
4
4
import * as core from "@actions/core" ;
5
+ import * as toolcache from "@actions/tool-cache" ;
5
6
import { pki } from "node-forge" ;
6
7
7
8
import * as actionsUtil from "./actions-util" ;
8
9
import * as util from "./util" ;
9
10
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" ;
10
15
const PROXY_USER = "proxy_user" ;
11
16
const KEY_SIZE = 2048 ;
12
17
const KEY_EXPIRY_YEARS = 2 ;
@@ -106,7 +111,17 @@ async function runWrapper() {
106
111
proxy_auth,
107
112
} ;
108
113
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 ) ;
110
125
let port = 49152 ;
111
126
try {
112
127
let subprocess : ChildProcess | undefined = undefined ;
0 commit comments