@@ -48,7 +48,7 @@ async function startInstanceRequest() {
4848 headers : {
4949 'Content-Type' : 'application/json' ,
5050 'X-Slab-Repository' : `${ config . githubContext . owner } /${ config . githubContext . repo } ` ,
51- 'X-Slab-Command' : 'start_instance ' ,
51+ 'X-Slab-Command' : 'start_instance_v2 ' ,
5252 'X-Hub-Signature-256' : `sha256=${ signature } `
5353 } ,
5454 body : body . toString ( )
@@ -116,6 +116,8 @@ async function stopInstanceRequest(runnerName) {
116116async function waitForInstance ( taskId , taskName ) {
117117 core . info ( `Wait for instance to ${ taskName } (task ID: ${ taskId } )` )
118118
119+ let runnerName
120+
119121 // while (true) equivalent to please ESLint
120122 for ( ; ; ) {
121123 await utils . sleep ( 15 )
@@ -127,12 +129,21 @@ async function waitForInstance(taskId, taskName) {
127129 const body = await response . json ( )
128130 const taskStatus = body [ taskName ] . status . toLowerCase ( )
129131
132+ core . info ( `DEBUG Instance task status: ${ taskStatus } ` ) // DEBUG
133+ core . info ( `DEBUG Instance task details: ${ body [ taskName ] . details } ` ) // DEBUG
134+
130135 if ( taskStatus === 'done' ) {
131136 if ( taskName === 'start' ) {
132137 await acknowledgeTaskDone ( taskId )
133138 }
134139 await removeTask ( taskId )
140+ body . runner_name = runnerName
135141 return body
142+ } else if (
143+ taskStatus === 'inprogress' &&
144+ body [ taskName ] . details . runner_name !== undefined
145+ ) {
146+ runnerName = body [ taskName ] . details . runner_name
136147 } else if ( taskStatus === 'failed' ) {
137148 core . error ( `Instance task failed (details: ${ body [ taskName ] . details } )` )
138149 core . error ( 'Failure occurred while waiting for instance.' )
@@ -150,7 +161,7 @@ async function waitForInstance(taskId, taskName) {
150161
151162async function getTask ( taskId ) {
152163 const url = config . input . slabUrl
153- const route = `task_status /${ config . githubContext . repo } /${ taskId } `
164+ const route = `backend_task /${ config . githubContext . repo } /${ taskId } `
154165 let response
155166
156167 try {
@@ -173,7 +184,7 @@ async function getTask(taskId) {
173184
174185async function removeTask ( taskId ) {
175186 const url = config . input . slabUrl
176- const route = `task_delete /${ config . githubContext . repo } /${ taskId } `
187+ const route = `backend_task /${ config . githubContext . repo } /${ taskId } `
177188 let response
178189
179190 try {
@@ -198,7 +209,7 @@ async function removeTask(taskId) {
198209
199210async function acknowledgeTaskDone ( taskId ) {
200211 const url = config . input . slabUrl
201- const route = `task_ack_done /${ config . githubContext . repo } /${ taskId } `
212+ const route = `backend_task_ack_done /${ config . githubContext . repo } /${ taskId } `
202213 let response
203214
204215 try {
0 commit comments