plumb task id through to abandon call
parent
2b966d15c9
commit
828fa88525
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -19,7 +19,6 @@ import {UploadArtifactResponse} from '@docker/actions-toolkit/lib/types/github';
|
||||||
import axios, {AxiosInstance} from 'axios';
|
import axios, {AxiosInstance} from 'axios';
|
||||||
|
|
||||||
import * as context from './context';
|
import * as context from './context';
|
||||||
import {report} from 'process';
|
|
||||||
|
|
||||||
const buildxVersion = 'v0.17.0';
|
const buildxVersion = 'v0.17.0';
|
||||||
|
|
||||||
|
@ -43,11 +42,10 @@ async function reportBuildCompleted() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async function reportBuildAbandoned() {
|
async function reportBuildAbandoned(taskId: string) {
|
||||||
try {
|
try {
|
||||||
const client = await getBlacksmithHttpClient();
|
const client = await getBlacksmithHttpClient();
|
||||||
const abandonURL = `/${stateHelper.blacksmithBuildTaskId}/abandon`;
|
const abandonURL = `/${taskId}/abandon`;
|
||||||
core.info(`Abandoning Blacksmith build: ${abandonURL}`);
|
|
||||||
const response = await client.post(abandonURL);
|
const response = await client.post(abandonURL);
|
||||||
core.info(`Docker build abandoned, tearing down Blacksmith builder for ${stateHelper.blacksmithBuildTaskId}: ${JSON.stringify(response.data)}`);
|
core.info(`Docker build abandoned, tearing down Blacksmith builder for ${stateHelper.blacksmithBuildTaskId}: ${JSON.stringify(response.data)}`);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
@ -126,7 +124,7 @@ async function getRemoteBuilderAddr(inputs: context.Inputs): Promise<string | nu
|
||||||
await new Promise(resolve => setTimeout(resolve, 200));
|
await new Promise(resolve => setTimeout(resolve, 200));
|
||||||
}
|
}
|
||||||
|
|
||||||
await reportBuildAbandoned();
|
await reportBuildAbandoned(taskId);
|
||||||
return null;
|
return null;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
if (error.response && error.response.status === 404) {
|
if (error.response && error.response.status === 404) {
|
||||||
|
|
Loading…
Reference in New Issue